Re: [V9fs-developer] [PATCH 4/6] 9p: Remove an unnecessary memory barrier

From: Dominique Martinet
Date: Thu Jun 28 2018 - 10:33:47 EST


Matthew Wilcox wrote on Thu, Jun 28, 2018:
> How about this?
>
> /*
> * This barrier is needed to make sure any change made to req before
> - * the other thread wakes up will indeed be seen by the waiting side.
> + * the status change is visible to another thread
> */

Yes, that sounds better.

This code is fairly old and I was wondering if the new WRITE_ONCE and
READ_ONCE macros would help but it looks like compile-time barriers only
so I do not think they would be enough...
Documentation/memory-barriers.txt still suggests something similar in
the "SLEEP AND WAKE-UP FUNCTIONS" section so I guess this is fine.


Thanks,
--
Dominique Martinet | Asmadeus