Messages in this thread | | | Date | Wed, 2 Apr 2008 15:07:22 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: [PATCH]: Fix SMP-reordering race in mark_buffer_dirty |
| |
On Wed, 2 Apr 2008, Andrew Morton wrote: > > But then the test-and-set of an already-set flag would newly cause the > cacheline to be dirtied, requiring additional bus usage to write it back? > > The CPU's test-and-set-bit operation could of course optimise that away in > this case. But does it?
No, afaik no current x86 uarch will optimize away the write on a locked instuction if it turns out to be unnecessary.
Can somebody find a timing reason to have the ugly code?
Linus
| |