[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190517175906.78742-1-yabinc@google.com>
Date: Fri, 17 May 2019 10:59:06 -0700
From: Yabin Cui <yabinc@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>
Cc: linux-kernel@...r.kernel.org, Yabin Cui <yabinc@...gle.com>
Subject: Re: [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 :)
Powered by blists - more mailing lists