LKML Archive on
help / color / mirror / Atom feed
* [PATCH 0/4 v6] max_threadx handling
@ 2015-03-15 16:13 Heinrich Schuchardt
  2015-03-15 16:13 ` [PATCH 1/4 v6] kernel/fork.c: new function for max_threads Heinrich Schuchardt
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Heinrich Schuchardt @ 2015-03-15 16:13 UTC (permalink / raw)
  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,
	Jonathan Corbet, 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, linux-doc, Heinrich Schuchardt

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 adds a description of threads-max to

New in version 6:
  Check against overflow of totalram_pages * PAGE_SIZE.
  Introduce argument of set_max_threads in 3rd patch where it is needed,
  not before.
  Update Documentation/sysctl/kernel.txt concerning threads-max.

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 <>
  David Rientjes <>
  Guenter Roeck <>
  Ingo Molnar <>
  Oleg Nesterov <>
  Peter Zijlstra <>
  Vladimir Davydov <>

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
  Doc/sysctl/kernel.txt: document threads-max

 Documentation/sysctl/kernel.txt | 21 +++++++++++
 include/linux/sysctl.h          |  3 ++
 init/main.c                     |  4 +--
 kernel/fork.c                   | 78 ++++++++++++++++++++++++++++++++++-------
 kernel/sysctl.c                 |  6 ++--
 5 files changed, 93 insertions(+), 19 deletions(-)


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-03-25 19:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-15 16:13 [PATCH 0/4 v6] max_threadx handling Heinrich Schuchardt
2015-03-15 16:13 ` [PATCH 1/4 v6] kernel/fork.c: new function for max_threads Heinrich Schuchardt
2015-03-15 16:13 ` [PATCH 2/4 v6] kernel/fork.c: avoid division by zero Heinrich Schuchardt
2015-03-16  7:41   ` Ingo Molnar
2015-03-17 19:19     ` Heinrich Schuchardt
2015-03-18 16:49       ` Ingo Molnar
2015-03-18 17:06         ` Oleg Nesterov
2015-03-25 12:25           ` Ingo Molnar
2015-03-15 16:13 ` [PATCH 3/4 v6] kernel/sysctl.c: threads-max observe limits Heinrich Schuchardt
2015-03-15 16:13 ` [PATCH 4/4 v6] Doc/sysctl/kernel.txt: document threads-max Heinrich Schuchardt
2015-03-15 16:30   ` Guenter Roeck
2015-03-25 18:59 ` [PATCH 0/4 v6] max_threadx handling Heinrich Schuchardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).