From: Jan Blunck Date: Tue, 16 Jun 2009 22:33:33 +0000 (-0700) Subject: atomic: only take lock when the counter drops to zero on UP as well X-Git-Tag: v2.6.31-rc1~299^2~73 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=417dcdf99ec9f8d8d6917189130bdc17cb67c678;p=pandora-kernel.git atomic: only take lock when the counter drops to zero on UP as well _atomic_dec_and_lock() should not unconditionally take the lock before calling atomic_dec_and_test() in the UP case. For consistency reasons it should behave exactly like in the SMP case. Besides that this works around the problem that with CONFIG_DEBUG_SPINLOCK this spins in __spin_lock_debug() if the lock is already taken even if the counter doesn't drop to 0. Signed-off-by: Jan Blunck Acked-by: Paul E. McKenney Acked-by: Nick Piggin Cc: Valerie Aurora Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed