Commit 75ab6eef authored by Andrew Morton's avatar Andrew Morton Committed by Christoph Hellwig

[PATCH] update nr_threads commentary

From: Manfred Spraul <manfred@colorfullife.com>

Update some no-longer-true comments around nr_threads locking.
parent d514577e
...@@ -43,7 +43,9 @@ static kmem_cache_t *task_struct_cachep; ...@@ -43,7 +43,9 @@ static kmem_cache_t *task_struct_cachep;
extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk); extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk);
extern void exit_semundo(struct task_struct *tsk); extern void exit_semundo(struct task_struct *tsk);
/* The idle threads do not count.. */ /* The idle threads do not count..
* Protected by write_lock_irq(&tasklist_lock)
*/
int nr_threads; int nr_threads;
int max_threads; int max_threads;
...@@ -792,9 +794,9 @@ static struct task_struct *copy_process(unsigned long clone_flags, ...@@ -792,9 +794,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
atomic_inc(&p->user->processes); atomic_inc(&p->user->processes);
/* /*
* Counter increases are protected by * If multiple threads are within copy_process(), then this check
* the kernel lock so nr_threads can't * triggers too late. This doesn't hurt, the check is only there
* increase under us (but it may decrease). * to stop root fork bombs.
*/ */
if (nr_threads >= max_threads) if (nr_threads >= max_threads)
goto bad_fork_cleanup_count; goto bad_fork_cleanup_count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment