diff options
author | Kan Liang <kan.liang@linux.intel.com> | 2020-08-21 22:57:53 +0300 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2020-09-10 12:19:34 +0300 |
commit | 44fae179ce73a26733d9e2d346da4e1a1cb94647 (patch) | |
tree | 58ae1e7e339127053c3ac96b445c75cff1b470b0 /include/linux/perf_event.h | |
parent | 556cccad389717d6eb4f5a24b45ff41cad3aaabf (diff) | |
download | linux-44fae179ce73a26733d9e2d346da4e1a1cb94647.tar.xz |
perf/core: Pull pmu::sched_task() into perf_event_context_sched_out()
The pmu::sched_task() is a context switch callback. It passes the
cpuctx->task_ctx as a parameter to the lower code. To find the
cpuctx->task_ctx, the current code iterates a cpuctx list.
The same context will iterated in perf_event_context_sched_out() soon.
Share the cpuctx->task_ctx can avoid the unnecessary iteration of the
cpuctx list.
The pmu::sched_task() is also required for the optimization case for
equivalent contexts.
The task_ctx_sched_out() will eventually disable and reenable the PMU
when schedule out events. Add perf_pmu_disable() and perf_pmu_enable()
around task_ctx_sched_out() don't break anything.
Drop the cpuctx->ctx.lock for the pmu::sched_task(). The lock is for
per-CPU context, which is not necessary for the per-task context
schedule.
No one uses sched_cb_entry, perf_sched_cb_usages, sched_cb_list, and
perf_pmu_sched_task() any more.
Suggested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200821195754.20159-2-kan.liang@linux.intel.com
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r-- | include/linux/perf_event.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 46a3974eb4fe..0c19d279b97f 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -872,7 +872,6 @@ struct perf_cpu_context { struct list_head cgrp_cpuctx_entry; #endif - struct list_head sched_cb_entry; int sched_cb_usage; int online; |