Commit 3e15a3fe authored by Peter Zijlstra's avatar Peter Zijlstra
Browse files

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: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarKan Liang <kan.liang@linux.intel.com>
Reviewed-by: default avatarNamhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240807115550.392851915@infradead.org
parent 5d95a2af
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3312,7 +3312,7 @@ static void __pmu_ctx_sched_out(struct perf_event_pmu_context *pmu_ctx,
		cpc->task_epc = NULL;
	}

	if (!event_type)
	if (!(event_type & EVENT_ALL))
		return;

	perf_pmu_disable(pmu);