We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1fd7e41 commit fe45bafCopy full SHA for fe45baf
kernel/events/core.c
@@ -3122,8 +3122,12 @@ static void perf_event_context_sched_in(struct perf_event_context *ctx,
3122
* We want to keep the following priority order:
3123
* cpu pinned (that don't need to move), task pinned,
3124
* cpu flexible, task flexible.
3125
+ *
3126
+ * However, if task's ctx is not carrying any pinned
3127
+ * events, no need to flip the cpuctx's events around.
3128
*/
- cpu_ctx_sched_out(cpuctx, EVENT_FLEXIBLE);
3129
+ if (!list_empty(&ctx->pinned_groups))
3130
+ cpu_ctx_sched_out(cpuctx, EVENT_FLEXIBLE);
3131
perf_event_sched_in(cpuctx, ctx, task);
3132
perf_pmu_enable(ctx->pmu);
3133
perf_ctx_unlock(cpuctx, ctx);
0 commit comments