lkml.org 
[lkml]   [2017]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] perf/core: Avoid context switch overheads
On Wed, Aug 09, 2017 at 08:29:21AM +0800, 石祤 wrote:
> From: "leilei.lin" <leilei.lin@alibaba-inc.com>
>
> A performance issue caused by less strickly check in task
> sched when these tasks were once attached by per-task perf_event.
>
> A task will alloc task->perf_event_ctxp[ctxn] when it was called
> by perf_event_open, and task->perf_event_ctxp[ctxn] would not
> ever be freed to NULL.
>
> __perf_event_task_sched_in()
> if (task->perf_event_ctxp[ctxn]) // here is always true
> perf_event_context_sched_in() // operate pmu
>
> 50% at most performance overhead was observed under some extreme
> test case. Therefore, add a more strick check as to ctx->nr_events,
> when ctx->nr_events == 0, it's no need to continue.
>
> Signed-off-by: leilei.lin <leilei.lin@alibaba-inc.com>

Thanks!

\
 
 \ /
  Last update: 2017-08-09 18:38    [W:0.377 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site