Messages in this thread | | | Date | Thu, 8 Jan 2015 12:51:17 +0100 | From | Peter Zijlstra <> | Subject | Re: [PATCH 11/11] perf/x86/intel: Enable conflicting event scheduling for CQM |
| |
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.
| |