Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752666AbbBWUQ2 (ORCPT ); Mon, 23 Feb 2015 15:16:28 -0500 Received: from mout.gmx.net ([212.227.15.18]:57978 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752165AbbBWUQ1 (ORCPT ); Mon, 23 Feb 2015 15:16:27 -0500 From: Heinrich Schuchardt To: Andrew Morton Cc: Aaron Tomlin , Andy Lutomirski , Davidlohr Bueso , David Rientjes , "David S. Miller" , Fabian Frederick , Guenter Roeck , "H. Peter Anvin" , Ingo Molnar , Jens Axboe , Joe Perches , Johannes Weiner , Kees Cook , Michael Marineau , Oleg Nesterov , "Paul E. McKenney" , Peter Zijlstra , Prarit Bhargava , Rik van Riel , Rusty Russell , Steven Rostedt , Thomas Gleixner , Vladimir Davydov , linux-kernel@vger.kernel.org, Heinrich Schuchardt Subject: [PATCH 0/4 v4] max_threadx handling Date: Mon, 23 Feb 2015 21:14:33 +0100 Message-Id: <1424722477-23758-1-git-send-email-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <20150222075825.GA20626@gmail.com> References: <20150222075825.GA20626@gmail.com> X-Provags-ID: V03:K0:klp2VJYNoXL747aSjZskrX1yLfv3Gs0XBpvgA/s/eAvMmqcbevx ra6nsQkpWdbqDeUjxieKEpWSBnF4tV/xwuLxShkXZrzOHARD46G+LsFdmasCvgeoF8s/mC/ p8tAlBWR7/ba304H1nTmBcmEJzWKzrV96e7axlEcPnJn5rCvXt1uarFZo2gqTsvSQ9MCxiA m8W4s1laiGg4Cw+TIHkTA== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1533 Lines: 47 In fork_init a division by zero may occur. In the first patch the calculation of max_threads is moved from fork_init to a new separate function. The incorrect calculation of max threads is addressed in the second patch. Furthermore max_threads is checked against FUTEX_TID_MASK. The third patch addresses max_threads being set by writing to /proc/sys/kernel/threads-max. The same limits are applied as in fork_init. The fourth patch uses a callback function to update max_threads when a memory hotplug event occurs. New in version 4: Separate of refactoring and correction into separate patches (as requested by Ingo Molnar) Remove redundant argument of fork_init New in version 3: Determination of max_threads moved to separate function. Handling of /proc/sys/kernel/threads-max Handling of memory hotplugging. Heinrich Schuchardt (4): kernel/fork.c: new function for max_threads kernel/fork.c: avoid division by zero kernel/sysctl.c: threads-max observe limits kernel/fork.c: memory hotplug updates max_threads include/linux/sysctl.h | 3 ++ init/main.c | 4 +- kernel/fork.c | 112 +++++++++++++++++++++++++++++++++++++++++-------- kernel/sysctl.c | 6 +-- 4 files changed, 102 insertions(+), 23 deletions(-) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/