Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752114AbbBXTjY (ORCPT ); Tue, 24 Feb 2015 14:39:24 -0500 Received: from mout.gmx.net ([212.227.17.20]:59859 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750748AbbBXTjX (ORCPT ); Tue, 24 Feb 2015 14:39:23 -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/3 v5] max_threadx handling Date: Tue, 24 Feb 2015 20:38:18 +0100 Message-Id: <1424806701-30099-1-git-send-email-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1424722477-23758-1-git-send-email-xypron.glpk@gmx.de> References: <1424722477-23758-1-git-send-email-xypron.glpk@gmx.de> X-Provags-ID: V03:K0:SDalH3oOs4LsfVfDjaXnIU2Zy2o4AP0hdviUjCtMizinxcPBD8C jfPUlYTsaGGO6hg4kVoNtZJhFjNGXnxN/KkhS5veHYnJOlb2NS7O2+R6Qc2gDQe65qCC6aN xTIfUFHeRdiA55x63HzIqSkPSKMdjSXocPbMLYliMW4kR0aArlbcRKLV7tZltfCXL1No+3J s5h+G7zjq4Qfv/XBQyIxQ== 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: 1857 Lines: 60 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. New in version 5: Do not update limits of the init process Do not update max_threads on memory hotplug events Corrections to commit messages New in version 4: Separation 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. New in version 2: Use div64_u64 for 64-bit division. Thank you for your helpful feedback: Andrew Morton Guenter Roeck Ingo Molnar Oleg Nesterov Peter Zijlstra Vladimir Davydov Heinrich Schuchardt (3): kernel/fork.c: new function for max_threads kernel/fork.c: avoid division by zero kernel/sysctl.c: threads-max observe limits include/linux/sysctl.h | 3 ++ init/main.c | 4 +-- kernel/fork.c | 75 +++++++++++++++++++++++++++++++++++++++++--------- kernel/sysctl.c | 6 ++-- 4 files changed, 69 insertions(+), 19 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/