lkml.org 
[lkml]   [2006]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] WorkStruct: Use direct assignment rather than cmpxchg()
On Thu, Dec 07, 2006 at 08:06:39PM +0000, David Howells wrote:
> Andrew Morton <akpm@osdl.org> wrote:
>
> > and we can assume (and ensure) that a failing test_and_set_bit() will not
> > write to the affected word at all.
>
> You may not assume that; and indeed that is not so in the generic
> spinlock-based bitops or ARM pre-v6 or PA-RISC or sparc32 or ...

Incorrect. pre-v6 ARM bitops for test_and_xxx_bit() all do:

save and disable irqs
load value
test bit
if not in desired state, alter bit and write it back
restore irqs

but I don't guarantee that we'll always do that - indeed, post-armv6
bitops always write back even if the bit was in the desired state.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-12-08 00:45    [W:0.065 / U:2.844 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site