Skip to content

perf_events: update extra shared registers management (v2)

Stephane Eranian lkml 1 version In review

Get series with b4
b4 am 20110520143707.GA5347@quad

Versions newest first

  1. v1 Latest3 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3perf_events: update Intel extra regs shared constraints management (v2)arch/x86/kernel/cpu/perf_event.c arch/x86/kernel/cpu/perf_event_intel.c include/linux/perf_event.h+200 -1520 replies
2/3perf_events: fix validation of events using an extra reg (v2)arch/x86/kernel/cpu/perf_event.c arch/x86/kernel/cpu/perf_event_intel.c+62 -184 replies
3/3perf_events: add Intel Sandy Bridge offcore_response low-level support (v2)arch/x86/kernel/cpu/perf_event.c arch/x86/kernel/cpu/perf_event_intel.c+12 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] perf_events: update extra shared registers management (v2)

The following short series of patches improves the code which manages the extra shared regs used by some events on Intel processors. Those events require an extra MSR which may be shared between siblings CPUs when HT is on. When HT is off, the kernel still needs to ensure that events within an event group do not try to program different values into that extra MSR.

This series improves the current code for managing the register sharing by using static allocation instead of dynamically trying to find a table slot to host that extra MSR. This greatly simplifies the code. The patch also prepare the kernel for more registers with those kinds of constraints (e.g, LBR_SELECT, LD_LAT).

The patch also adds the missing group validation of events using those extra MSRs. Up until now, one could put two instances of the those events which had incompatible values for the extra MSR. There was no upfront check and the group would never be scheduled. Now, such group cannot be constructed anymore (fail early).

Finally, the third patch adds the SandyBridge support for the offcore_response events (which use these shared MSR). It also removes the offcore_response events from the SandyBridge constraint event table. Those events don't have any constraints contrary to what's published in the documentation.

The second version updates PATCH 1/3 which was an older version with reg->idx initialization problems.

[PATCH 0/3] introduction
[PATCH 1/3] rework of the register sharing logic [PATCH 2/3] add missing shared regs validation [PATCH 3/3] add Intel SandyBridge offcore_response support

---