lkml.org 
[lkml]   [2019]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] perf: convert perf_event_context.refcount to refcount_t
On Mon, Jan 28, 2019 at 02:27:26PM +0200, Elena Reshetova wrote:
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 3cd13a3..a1e87d2 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -1171,7 +1171,7 @@ static void perf_event_ctx_deactivate(struct perf_event_context *ctx)
>
> static void get_ctx(struct perf_event_context *ctx)
> {
> - WARN_ON(!atomic_inc_not_zero(&ctx->refcount));
> + WARN_ON(!refcount_inc_not_zero(&ctx->refcount));

This could be refcount_inc(), remember how that already produces a WARN
when we try and increment 0.

\
 
 \ /
  Last update: 2019-01-29 10:38    [W:0.163 / U:4.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site