aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorKan Liang <kan.liang@linux.intel.com>2020-08-21 12:57:53 -0700
committerPeter Zijlstra <peterz@infradead.org>2020-09-10 11:19:34 +0200
commit44fae179ce73a26733d9e2d346da4e1a1cb94647 (patch)
tree58ae1e7e339127053c3ac96b445c75cff1b470b0 /include/linux
parentperf/core: Pull pmu::sched_task() into perf_event_context_sched_in() (diff)
downloadlinux-dev-44fae179ce73a26733d9e2d346da4e1a1cb94647.tar.xz
linux-dev-44fae179ce73a26733d9e2d346da4e1a1cb94647.zip
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')
-rw-r--r--include/linux/perf_event.h1
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;