[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87ef50xlb8.fsf@ashishki-desk.ger.corp.intel.com>
Date: Wed, 15 May 2019 09:51:07 +0300
From: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
To: Yabin Cui <yabinc@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>
Cc: linux-kernel@...r.kernel.org, Yabin Cui <yabinc@...gle.com>,
alexander.shishkin@...ux.intel.com
Subject: Re: [PATCH] perf/ring_buffer: Fix exposing a temporarily decreased data_head.
Yabin Cui <yabinc@...gle.com> writes:
> diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
> index 674b35383491..0b9aefe13b04 100644
> --- a/kernel/events/ring_buffer.c
> +++ b/kernel/events/ring_buffer.c
> @@ -54,8 +54,10 @@ static void perf_output_put_handle(struct perf_output_handle *handle)
> * IRQ/NMI can happen here, which means we can miss a head update.
> */
>
> - if (!local_dec_and_test(&rb->nest))
> + if (local_read(&rb->nest) > 1) {
> + local_dec(&rb->nest);
What stops rb->nest changing between local_read() and local_dec()?
Regards,
--
Alex
Powered by blists - more mailing lists