iommu/vt-d: Support cpumask for IOMMU perfmon
The perf subsystem assumes that all counters are by default per-CPU. So the user space tool reads a counter from each CPU. However, the IOMMU counters are system-wide and can be read from any CPU. Here we use a CPU mask to restrict counting to one CPU to handle the issue. (with CPU hotplug notifier to choose a different CPU if the chosen one is taken off-line). The CPU is exposed to /sys/bus/event_source/devices/dmar*/cpumask for the user space perf tool. Signed-off-by:Kan Liang <kan.liang@linux.intel.com> Link: https://lore.kernel.org/r/20230128200428.1459118-6-kan.liang@linux.intel.com Signed-off-by:
Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by:
Joerg Roedel <jroedel@suse.de>
Showing
- Documentation/ABI/testing/sysfs-bus-event_source-devices-iommu 8 additions, 0 deletions...entation/ABI/testing/sysfs-bus-event_source-devices-iommu
- drivers/iommu/intel/perfmon.c 105 additions, 8 deletionsdrivers/iommu/intel/perfmon.c
- include/linux/cpuhotplug.h 1 addition, 0 deletionsinclude/linux/cpuhotplug.h
Loading
Please register or sign in to comment