Re: [PATCH 11/11] perf/x86/intel: Enable conflicting event scheduling for CQM

From: Peter Zijlstra
Date: Thu Jan 08 2015 - 06:51:40 EST


On Fri, Nov 14, 2014 at 09:15:12PM +0000, Matt Fleming wrote:
> +/*
> + * Deallocate the RMIDs from any events that conflict with @event, and
> + * place them on the back of the group list.
> + */
> +static void intel_cqm_sched_out_events(struct perf_event *event)
> +{
> + struct perf_event *group, *g;
> + unsigned int rmid;
>
> + lockdep_assert_held(&cache_mutex);
> +
> + list_for_each_entry_safe(group, g, &cache_groups, hw.cqm_groups_entry) {
> + if (group == event)
> + continue;
> +
> + rmid = group->hw.cqm_rmid;
> +
> + /*
> + * Skip events that don't have a valid RMID.
> + */
> + if (!__rmid_valid(rmid))
> + continue;
> +
> + /*
> + * No conflict? No problem! Leave the event alone.
> + */
> + if (!__conflict_event(group, event))
> + continue;
> +
> + intel_cqm_xchg_rmid(group, INVALID_RMID);
> + __put_rmid(rmid);
> +
> + list_move_tail(&group->hw.cqm_groups_entry, &cache_groups);
> + }
> }

I'm not sure about that list_move_tail() there, is wrecks the rotation
order and would cause conflicting events to get less than their 'fair'
share I suspect.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/