Messages in this thread | | | Date | Fri, 17 May 2019 10:59:06 -0700 | Subject | Re: [PATCH] perf/ring_buffer: Fix exposing a temporarily decreased data_head. | From | Yabin Cui <> |
| |
> > - local_inc(&rb->nest); > > + rb->nest++; > > + barrier();
> Urgh; almost but not quite. You just lost the 'volatile' qualifier and > now the compiler can mess things up for you.
I thought the barriers added could force the compiler to forget what it knows about rb->nest, and do the write as been told to. I appreciate it if you can tell me more details about it. Anyway, it's a good choice to be protective and always use WRITE_ONCE/READ_ONCE for rb->nest.
> What I'm going to do is split this into two patches, one fixes the > problem and marked for backport, and one changing away from local_t.
I read the split patches. They totally LGTM. Thanks for all your help and rapid reply! I appreciate it :)
| |