Messages in this thread | | | From | Andi Kleen <> | Subject | Re: [PATCH] buffer: Avoid setting buffer bits that are already set | Date | Mon, 23 Oct 2017 18:21:21 -0700 |
| |
kemi <kemi.wang@intel.com> writes: > > I'll see if I can find some >> time to implement the above in a nice way. > > Agree. Maybe something like test_and_set_bit() would be more suitable.
test_and_set_bit is a very different operation for the CPU because it is atomic for both. But we want the initial read to not be atomic.
If you add special functions use a different variant that is only atomic for the set.
-Andi
| |