Revision abd96ecb298675a21c412a29f5de2f80174d5f18 authored by Oleg Nesterov on 22 August 2007, 21:01:58 UTC, committed by Linus Torvalds on 23 August 2007, 02:52:47 UTC
de_thread:

	if (atomic_read(&oldsighand->count) <= 1)
		BUG_ON(atomic_read(&sig->count) != 1);

This is not safe without the rmb() in between.  The results of two
correctly ordered __exit_signal()->atomic_dec_and_test()'s could be seen
out of order on our CPU.

The same is true for the "thread_group_empty()" case, __unhash_process()'s
changes could be seen before atomic_dec_and_test(&sig->count).

On some platforms (including i386) atomic_read() doesn't provide even the
compiler barrier, in that case these checks are simply racy.

Remove these BUG_ON()'s. Alternatively, we can do something like

	BUG_ON( ({ smp_rmb(); atomic_read(&sig->count) != 1; }) );

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5c076fc
History
File Mode Size
check-all.sh -rw-r--r-- 434 bytes
rt-tester.py -rw-r--r-- 5.2 KB
t2-l1-2rt-sameprio.tst -rw-r--r-- 1.6 KB
t2-l1-pi.tst -rw-r--r-- 1.4 KB
t2-l1-signal.tst -rw-r--r-- 1.3 KB
t2-l2-2rt-deadlock.tst -rw-r--r-- 1.4 KB
t3-l1-pi-1rt.tst -rw-r--r-- 1.5 KB
t3-l1-pi-2rt.tst -rw-r--r-- 1.5 KB
t3-l1-pi-3rt.tst -rw-r--r-- 1.5 KB
t3-l1-pi-signal.tst -rw-r--r-- 1.7 KB
t3-l1-pi-steal.tst -rw-r--r-- 1.7 KB
t3-l2-pi.tst -rw-r--r-- 1.5 KB
t4-l2-pi-deboost.tst -rw-r--r-- 2.1 KB
t5-l4-pi-boost-deboost-setsched.tst -rw-r--r-- 3.0 KB
t5-l4-pi-boost-deboost.tst -rw-r--r-- 2.3 KB

back to top