lkml.org 
[lkml]   [2019]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] perf/ring_buffer: Fix exposing a temporarily decreased data_head.
Date
Yabin Cui <yabinc@google.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

\
 
 \ /
  Last update: 2019-05-15 08:52    [W:0.074 / U:11.232 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site