[lkml]   [2019]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] perf/ring_buffer: Fix exposing a temporarily decreased data_head.
> > -	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 :)

 \ /
  Last update: 2019-05-17 19:59    [W:0.043 / U:49.900 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site