Re: [PATCH v2 2/6] perf, x86: Add Intel Nehalem/Westmere uncore pmu

From: Peter Zijlstra
Date: Mon Jul 18 2011 - 12:12:08 EST


On Mon, 2011-07-18 at 22:54 +0800, Lin Ming wrote:
> > I guess we can start with this, there is still the issue of mapping the
> > events to a single active cpu in the node, but I guess we can do that a
> > little later.
>
> Do we really need this mapping with uncore pmu interrupt disabled?

Yes, because event scheduling is per-cpu. Suppose you've got 8 events, 7
on one cpu, 1 on another, all fits, everything is fine.

Now add an event to the cpu that has 1, at that point the new event
fails to fit on the cpu and that context ends up with nr_events !=
nr_active, and rotation starts.

Now instead of rotating between all 9 events, each getting 8/9 of the
time. It will only rotate the two events, resulting in 7 events that are
always on, and 2 that are on 50-50.

Also, consider cpu-hotplug, for as long as there is at least one core of
the node active, we can count all these events. But now, suppose we
unplug the core with the 7 counters on, they all die.

Anyway, we can fix that later once we get something working.
--
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/