linux-kernel-test/include
Eric W. Biederman de12a7878c [PATCH] de_thread: Don't confuse users do_each_thread.
Oleg Nesterov spotted two interesting bugs with the current de_thread
code.  The simplest is a long standing double decrement of
__get_cpu_var(process_counts) in __unhash_process.  Caused by
two processes exiting when only one was created.

The other is that since we no longer detach from the thread_group list
it is possible for do_each_thread when run under the tasklist_lock to
see the same task_struct twice.  Once on the task list as a
thread_group_leader, and once on the thread list of another
thread.

The double appearance in do_each_thread can cause a double increment
of mm_core_waiters in zap_threads resulting in problems later on in
coredump_wait.

To remedy those two problems this patch takes the simple approach
of changing the old thread group leader into a child thread.
The only routine in release_task that cares is __unhash_process,
and it can be trivially seen that we handle cleaning up a
thread group leader properly.

Since de_thread doesn't change the pid of the exiting leader process
and instead shares it with the new leader process.  I change
thread_group_leader to recognize group leadership based on the
group_leader field and not based on pids.  This should also be
slightly cheaper then the existing thread_group_leader macro.

I performed a quick audit and I couldn't see any user of
thread_group_leader that cared about the difference.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-04-10 16:36:50 -07:00
..
acpi
asm-alpha [PATCH] alpha: make poll flags the same as other architectures 2006-03-28 09:16:02 -08:00
asm-arm Merge master.kernel.org:/home/rmk/linux-2.6-arm 2006-04-02 13:34:00 -07:00
asm-arm26 [PATCH] unify pfn_to_page: arm26 pfn_to_page 2006-03-27 08:44:44 -08:00
asm-cris [PATCH] unify pfn_to_page: cris pfn_to_page 2006-03-27 08:44:45 -08:00
asm-frv [PATCH] lightweight robust futexes updates 2006-03-27 08:44:49 -08:00
asm-generic [PATCH] mutex: some cleanups 2006-03-31 12:19:01 -08:00
asm-h8300 [PATCH] unify pfn_to_page: h8300 pfn_to_page 2006-03-27 08:44:45 -08:00
asm-i386 [PATCH] x86_64: Fix drift with HPET timer enabled 2006-04-09 11:53:53 -07:00
asm-ia64 [IA64] Avoid "u64 foo : 32;" for gcc3 vs. gcc4 compatibility 2006-03-31 10:28:29 -08:00
asm-m32r [PATCH] unify PFN_* macros 2006-03-27 08:44:48 -08:00
asm-m68k [PATCH] m68k: fix undefined reference to generic_find_next_zero_le_bit 2006-03-26 08:57:13 -08:00
asm-m68knommu [PATCH] bitops: m68knommu: use generic bitops 2006-03-26 08:57:13 -08:00
asm-mips Merge master.kernel.org:/home/rmk/linux-2.6-serial 2006-03-28 13:52:37 -08:00
asm-parisc [PARISC] Add atomic_sub_and_test 2006-03-30 17:48:59 +00:00
asm-powerpc [PATCH] powerpc/pseries: EEH Cleanup 2006-04-01 22:37:11 +11:00
asm-ppc [PATCH] lock PTE before updating it in 440/BookE page fault handler 2006-03-29 13:44:15 +11:00
asm-s390 [PATCH] for_each_possible_cpu: s390 2006-03-31 12:18:52 -08:00
asm-sh [PATCH] Typo fixes 2006-03-28 09:16:08 -08:00
asm-sh64 [PATCH] unify PFN_* macros 2006-03-27 08:44:48 -08:00
asm-sparc [SPARC]: Wire up sys_sync_file_range() into syscall tables. 2006-03-31 23:49:34 -08:00
asm-sparc64 [SPARC]: Wire up sys_sync_file_range() into syscall tables. 2006-03-31 23:49:34 -08:00
asm-um [PATCH] uml: check for differences in host support 2006-03-31 12:18:52 -08:00
asm-v850 [PATCH] unify pfn_to_page: v850 pfn_to_page 2006-03-27 08:44:47 -08:00
asm-x86_64 [PATCH] x86_64: Eliminate IA32_NR_syscalls define 2006-04-09 11:53:53 -07:00
asm-xtensa [PATCH] unify pfn_to_page: xtensa pfn_to_page 2006-03-27 08:44:47 -08:00
keys
linux [PATCH] de_thread: Don't confuse users do_each_thread. 2006-04-10 16:36:50 -07:00
math-emu
media V4L/DVB (3702): Make msp3400 routing defines more consistent 2006-04-02 04:56:11 -03:00
mtd
net [IPV6]: Deinline few large functions in inet6 code 2006-04-09 22:48:59 -07:00
pcmcia [PATCH] pcmcia: declare pccard_iodyn_ops (fix m8xx_pcmcia.c compilation error) 2006-03-31 21:49:51 +02:00
rdma IB/mad: RMPP support for additional classes 2006-03-30 07:19:51 -08:00
rxrpc
scsi [PATCH] move ->eh_strategy_handler to the transport class 2006-04-10 14:15:47 -04:00
sound Update dummy snd_power_wait() function for new calling convention 2006-04-02 14:37:36 -07:00
video [PATCH] Remove MODULE_PARM 2006-03-25 08:22:52 -08:00