Skip to content

Commit 3e15a3f

Browse files
author
Peter Zijlstra
committed
perf: Optimize __pmu_ctx_sched_out()
There is is no point in doing the perf_pmu_disable() dance just to do nothing. This happens for ctx_sched_out(.type = EVENT_TIME) for instance. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Kan Liang <kan.liang@linux.intel.com> Reviewed-by: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/r/20240807115550.392851915@infradead.org
1 parent 5d95a2a commit 3e15a3f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/events/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3312,7 +3312,7 @@ static void __pmu_ctx_sched_out(struct perf_event_pmu_context *pmu_ctx,
33123312
cpc->task_epc = NULL;
33133313
}
33143314

3315-
if (!event_type)
3315+
if (!(event_type & EVENT_ALL))
33163316
return;
33173317

33183318
perf_pmu_disable(pmu);

0 commit comments

Comments
 (0)