Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf/x86/intel/uncore: Add per-scheduler IMC CAS count events

IMC on SPR and EMR does not support sub-channels. In contrast, CPUs
that use gnr_uncores[] (e.g. Granite Rapids and Sierra Forest)
implement two command schedulers (SCH0/SCH1) per memory channel,
providing logically independent command and data paths.

Do not reuse the spr_uncore_imc[] configuration for these CPUs.
Instead, introduce a dedicated gnr_uncore_imc[] with per-scheduler
events, so userspace can monitor SCH0 and SCH1 independently.

On these CPUs, replace cas_count_{read,write} with
cas_count_{read,write}_sch{0,1}. This may break existing userspace
that relies on cas_count_{read,write}, prompting it to switch to the
per-scheduler events, as the legacy event reports only partial
traffic (SCH0).

Fixes: 632c4bf6d007 ("perf/x86/intel/uncore: Support Granite Rapids")
Fixes: cb4a6ccf3583 ("perf/x86/intel/uncore: Support Sierra Forest and Grand Ridge")
Reported-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260210005225.20311-1-zide.chen@intel.com

authored by

Zide Chen and committed by
Peter Zijlstra
6a8a4864 486ff5ad

+27 -1
+27 -1
arch/x86/events/intel/uncore_snbep.c
··· 6497 6497 .attr_update = uncore_alias_groups, 6498 6498 }; 6499 6499 6500 + static struct uncore_event_desc gnr_uncore_imc_events[] = { 6501 + INTEL_UNCORE_EVENT_DESC(clockticks, "event=0x01,umask=0x00"), 6502 + INTEL_UNCORE_EVENT_DESC(cas_count_read_sch0, "event=0x05,umask=0xcf"), 6503 + INTEL_UNCORE_EVENT_DESC(cas_count_read_sch0.scale, "6.103515625e-5"), 6504 + INTEL_UNCORE_EVENT_DESC(cas_count_read_sch0.unit, "MiB"), 6505 + INTEL_UNCORE_EVENT_DESC(cas_count_read_sch1, "event=0x06,umask=0xcf"), 6506 + INTEL_UNCORE_EVENT_DESC(cas_count_read_sch1.scale, "6.103515625e-5"), 6507 + INTEL_UNCORE_EVENT_DESC(cas_count_read_sch1.unit, "MiB"), 6508 + INTEL_UNCORE_EVENT_DESC(cas_count_write_sch0, "event=0x05,umask=0xf0"), 6509 + INTEL_UNCORE_EVENT_DESC(cas_count_write_sch0.scale, "6.103515625e-5"), 6510 + INTEL_UNCORE_EVENT_DESC(cas_count_write_sch0.unit, "MiB"), 6511 + INTEL_UNCORE_EVENT_DESC(cas_count_write_sch1, "event=0x06,umask=0xf0"), 6512 + INTEL_UNCORE_EVENT_DESC(cas_count_write_sch1.scale, "6.103515625e-5"), 6513 + INTEL_UNCORE_EVENT_DESC(cas_count_write_sch1.unit, "MiB"), 6514 + { /* end: all zeroes */ }, 6515 + }; 6516 + 6517 + static struct intel_uncore_type gnr_uncore_imc = { 6518 + SPR_UNCORE_MMIO_COMMON_FORMAT(), 6519 + .name = "imc", 6520 + .fixed_ctr_bits = 48, 6521 + .fixed_ctr = SNR_IMC_MMIO_PMON_FIXED_CTR, 6522 + .fixed_ctl = SNR_IMC_MMIO_PMON_FIXED_CTL, 6523 + .event_descs = gnr_uncore_imc_events, 6524 + }; 6525 + 6500 6526 static struct intel_uncore_type gnr_uncore_pciex8 = { 6501 6527 SPR_UNCORE_PCI_COMMON_FORMAT(), 6502 6528 .name = "pciex8", ··· 6570 6544 NULL, 6571 6545 &spr_uncore_pcu, 6572 6546 &gnr_uncore_ubox, 6573 - &spr_uncore_imc, 6547 + &gnr_uncore_imc, 6574 6548 NULL, 6575 6549 &gnr_uncore_upi, 6576 6550 NULL,