Re: test_and_set_bit implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 12, 2006 at 09:22:44AM -0800, Christoph Lameter wrote:
> On Tue, 12 Dec 2006, Matthew Wilcox wrote:
> 
> > The original code and your rewrite both access memory twice in the loop.
> > Why don't we do it with one memory reference per loop instead?
> 
> Because the the cmpxchg usually succeeds. It is rare that we have to redo 
> the loop.

Even if the loop executes exactly once, we still win by an ld4 vs an
ld4.acq.  It can't be less expensive to do an ld4.acq than it is to do
an ld4.
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Sparc Linux]     [DCCP]     [Linux ARM]     [Yosemite News]     [Linux SCSI]     [Linux x86_64]     [Linux for Ham Radio]

  Powered by Linux