[lkml]   [2006]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] i386 add idle notifier
On Wed, Nov 29, 2006 at 03:05:44PM -0800, Andrew Morton wrote:
> btw, I don't think anyone promised that __test_and_set_bit is atomic wrt
> interrupts on all architectures. Is OK for x86.

Correct. The generic version found in include/asm-generic/bitops/non-atomic.h
is not interrupt safe:

* __test_and_set_bit - Set a bit and return its old value
* @nr: Bit to set
* @addr: Address to count from
* This operation is non-atomic and can be reordered.
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.

Russell King
Linux kernel 2.6 ARM Linux -
maintainer of:
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2006-11-30 00:19    [W:0.457 / U:4.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site