Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e002cfc authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Revert "perf/core: Fix corner case in perf_rotate_context()"



This reverts commit c3178964 as it
breaks the abi.

Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
Change-Id: Iac4d2decc2a576084ece3e4533eb15a01228365e
parent 7fb3f18d
Loading
Loading
Loading
Loading
+5 −17
Original line number Diff line number Diff line
@@ -3689,23 +3689,11 @@ static void rotate_ctx(struct perf_event_context *ctx, struct perf_event *event)
	perf_event_groups_insert(&ctx->flexible_groups, event);
}

/* pick an event from the flexible_groups to rotate */
static inline struct perf_event *
ctx_event_to_rotate(struct perf_event_context *ctx)
ctx_first_active(struct perf_event_context *ctx)
{
	struct perf_event *event;

	/* pick the first active flexible event */
	event = list_first_entry_or_null(&ctx->flexible_active,
	return list_first_entry_or_null(&ctx->flexible_active,
					struct perf_event, active_list);

	/* if no active flexible event, pick the first event */
	if (!event) {
		event = rb_entry_safe(rb_first(&ctx->flexible_groups.tree),
				      typeof(*event), group_node);
	}

	return event;
}

static bool perf_rotate_context(struct perf_cpu_context *cpuctx)
@@ -3730,9 +3718,9 @@ static bool perf_rotate_context(struct perf_cpu_context *cpuctx)
	perf_pmu_disable(cpuctx->ctx.pmu);

	if (task_rotate)
		task_event = ctx_event_to_rotate(task_ctx);
		task_event = ctx_first_active(task_ctx);
	if (cpu_rotate)
		cpu_event = ctx_event_to_rotate(&cpuctx->ctx);
		cpu_event = ctx_first_active(&cpuctx->ctx);

	/*
	 * As per the order given at ctx_resched() first 'pop' task flexible