Hello Mateusz, On 09/10/17(Mon) 21:43, Mateusz Guzik wrote: > I was looking at rw lock code out of curiosity and noticed you always do > membar_enter which on MP-enabled amd64 kernel translates to mfence. > This makes the entire business a little bit slower. > > Interestingly you already have relevant macros for amd64: > #define membar_enter_after_atomic() __membar("") > #define membar_exit_before_atomic() __membar("")
If you look at the history, you'll see that theses macro didn't exist when membar_* where added to rw locks. > And there is even a default variant for archs which don't provide one. > I guess the switch should be easy. Then please do it :) At lot of stuff is easy on OpenBSD but we are not enough. Do it, test it, explain it, get oks and commit it 8)