lkml.org 
[lkml]   [2016]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/4] perf/core: check return value of perf_event_read IPI

* David Carrillo-Cisneros <davidcc@google.com> wrote:

> The call to smp_call_function_single in perf_event_read() may fail and,
> when it does, its error value is the one to return.
>
> Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
> Reviewed-by: Stephane Eranian <eranian@google.com>
> ---
> kernel/events/core.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 9345028..96523fd 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -3469,9 +3469,9 @@ static int perf_event_read(struct perf_event *event, bool group)
> .group = group,
> .ret = 0,
> };
> - smp_call_function_single(event->oncpu,
> - __perf_event_read, &data, 1);
> - ret = data.ret;
> + ret = smp_call_function_single(event->oncpu,
> + __perf_event_read, &data, 1);
> + ret = ret ? : data.ret;
> } else if (event->state == PERF_EVENT_STATE_INACTIVE) {
> struct perf_event_context *ctx = event->ctx;
> unsigned long flags;

Please also describe the symptoms of the bug - under what circumstances may the
smp-call fail and how does the user notice?

Thanks,

Ingo

\
 
 \ /
  Last update: 2016-08-10 22:41    [W:0.115 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site