<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/resctrl/mpam_resctrl.c, branch v7.3-rc1</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.3-rc1</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.3-rc1'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-08-02T09:33:43+00:00</updated>
<entry>
<title>arm_mpam: resctrl: Add resctrl_arch_cntr_read() &amp; resctrl_arch_reset_cntr()</title>
<updated>2026-08-02T09:33:43+00:00</updated>
<author>
<name>James Morse</name>
<email>james.morse@arm.com</email>
</author>
<published>2026-07-31T17:52:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a5ff6ef2d73e87ff001c19c8d877d6dc8c249b67'/>
<id>urn:sha1:a5ff6ef2d73e87ff001c19c8d877d6dc8c249b67</id>
<content type='text'>
When used in 'mbm_event' mode, ABMC emulation, resctrl uses arch hooks to
read and reset the memory bandwidth utilization (MBWU) counters.

Add these.

Signed-off-by: James Morse &lt;james.morse@arm.com&gt;
Signed-off-by: Ben Horgan &lt;ben.horgan@arm.com&gt;
Tested-by: Shaopeng Tan &lt;tan.shaopeng@jp.fujitsu.com&gt;
Tested-by: Fenghua Yu &lt;fenghuay@nvidia.com&gt;
Tested-by: Gavin Shan &lt;gshan@redhat.com&gt;
Reviewed-by: Jonathan Cameron &lt;jonathan.cameron@huawei.com&gt;
Reviewed-by: Shaopeng Tan &lt;tan.shaopeng@jp.fujitsu.com&gt;
Reviewed-by: Fenghua Yu &lt;fenghuay@nvidia.com&gt;
Reviewed-by: Gavin Shan &lt;gshan@redhat.com&gt;
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>arm_mpam: resctrl: Add resctrl_arch_config_cntr() for ABMC use</title>
<updated>2026-08-02T09:33:43+00:00</updated>
<author>
<name>James Morse</name>
<email>james.morse@arm.com</email>
</author>
<published>2026-07-31T17:52:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6e0e538a75ceb95583b91d05abfe315bdbc5c967'/>
<id>urn:sha1:6e0e538a75ceb95583b91d05abfe315bdbc5c967</id>
<content type='text'>
ABMC, mbm_event mode, has a helper resctrl_arch_config_cntr() for changing
the mapping between 'cntr_id' and a CLOSID/RMID pair.

Add the helper.

For MPAM this is done by updating the mon-&gt;mbwu_idx_to_mon[] array, and as
usual CDP means it needs doing in three different ways.

Signed-off-by: James Morse &lt;james.morse@arm.com&gt;
Signed-off-by: Ben Horgan &lt;ben.horgan@arm.com&gt;
Tested-by: Shaopeng Tan &lt;tan.shaopeng@jp.fujitsu.com&gt;
Tested-by: Fenghua Yu &lt;fenghuay@nvidia.com&gt;
Tested-by: Gavin Shan &lt;gshan@redhat.com&gt;
Reviewed-by: Jonathan Cameron &lt;jonathan.cameron@huawei.com&gt;
Reviewed-by: Shaopeng Tan &lt;tan.shaopeng@jp.fujitsu.com&gt;
Reviewed-by: Fenghua Yu &lt;fenghuay@nvidia.com&gt;
Reviewed-by: Gavin Shan &lt;gshan@redhat.com&gt;
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>arm_mpam: resctrl: Pre-allocate assignable monitors</title>
<updated>2026-08-02T09:33:43+00:00</updated>
<author>
<name>Ben Horgan</name>
<email>ben.horgan@arm.com</email>
</author>
<published>2026-07-31T17:52:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=779cfd65316806b55a8c8fa50579e0d025310bc0'/>
<id>urn:sha1:779cfd65316806b55a8c8fa50579e0d025310bc0</id>
<content type='text'>
MPAM is able to emulate ABMC, i.e. mbm_event mode, by making memory
bandwidth monitors assignable. Rather than supporting the 'default'
mbm_assign_mode always use 'mbm_event' mode even if there are sufficient
memory bandwidth monitors. The per monitor event configuration is only
provided by resctrl when in 'mbm_event' mode and so only allowing
'mbm_event' mode will make it easier to support per-monitor event
configuration for MPAM. For the moment, the only event supported is
mbm_total_event with no bandwidth type configuration. The 'mbm_assign_mode'
file will still show 'default' when there is no support for memory
bandwidth monitoring.

The monitors need to be allocated from the driver, and mapped to whichever
control/monitor group resctrl wants to use them with.

Add a second array to hold the monitor values indexed by resctrl's cntr_id.

When CDP is in use, two monitors are needed so the available number of
counters halves. Platforms with one monitor will have zero monitors when
CDP is in use.

Co-developed-by: James Morse &lt;james.morse@arm.com&gt;
Signed-off-by: James Morse &lt;james.morse@arm.com&gt;
Signed-off-by: Ben Horgan &lt;ben.horgan@arm.com&gt;
Tested-by: Shaopeng Tan &lt;tan.shaopeng@jp.fujitsu.com&gt;
Tested-by: Fenghua Yu &lt;fenghuay@nvidia.com&gt;
Tested-by: Gavin Shan &lt;gshan@redhat.com&gt;
Reviewed-by: Shaopeng Tan &lt;tan.shaopeng@jp.fujitsu.com&gt;
Reviewed-by: Fenghua Yu &lt;fenghuay@nvidia.com&gt;
Reviewed-by: Gavin Shan &lt;gshan@redhat.com&gt;
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>arm_mpam: resctrl: Pick classes for use as MBM counters</title>
<updated>2026-08-02T09:33:43+00:00</updated>
<author>
<name>James Morse</name>
<email>james.morse@arm.com</email>
</author>
<published>2026-07-31T17:52:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=436d111d918ae106d7545b1fad6fe42294447603'/>
<id>urn:sha1:436d111d918ae106d7545b1fad6fe42294447603</id>
<content type='text'>
resctrl has two types of bandwidth counters, NUMA-local and global. MPAM
can only count globally; either using MSC at the L3 cache or in the memory
controllers. When global and local equate to the same thing continue just
to call it global.

Pick the corresponding MPAM classes to back the MBM counters. As resctrl
requires all monitors to be at the L3 cache, we can only use the counters
at the memory controllers when they have the same topology as the L3 cache
and the traffic they see if the same. In particular, for the bandwidth
counters at the memory controllers to be exposed to resctrl it is required
there is a single L3 cache and a single NUMA node as otherwise cross NUMA
traffic will be counted at the wrong instance.

Signed-off-by: James Morse &lt;james.morse@arm.com&gt;
Signed-off-by: Ben Horgan &lt;ben.horgan@arm.com&gt;
Tested-by: Shaopeng Tan &lt;tan.shaopeng@jp.fujitsu.com&gt;
Tested-by: Zeng Heng &lt;zengheng4@huawei.com&gt;
Tested-by: Fenghua Yu &lt;fenghuay@nvidia.com&gt;
Tested-by: Gavin Shan &lt;gshan@redhat.com&gt;
Reviewed-by: Shaopeng Tan &lt;tan.shaopeng@jp.fujitsu.com&gt;
Reviewed-by: Jonathan Cameron &lt;jonathan.cameron@huawei.com&gt;
Reviewed-by: Fenghua Yu &lt;fenghuay@nvidia.com&gt;
Reviewed-by: Gavin Shan &lt;gshan@redhat.com&gt;
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>arm_mpam: resctrl: Make resctrl_mon_ctx_waiters static</title>
<updated>2026-04-17T16:48:07+00:00</updated>
<author>
<name>Ben Horgan</name>
<email>ben.horgan@arm.com</email>
</author>
<published>2026-04-14T13:27:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4d5bbbafc170eb21474a37d844211fce6b0f3c51'/>
<id>urn:sha1:4d5bbbafc170eb21474a37d844211fce6b0f3c51</id>
<content type='text'>
resctrl_mon_ctx_waiters is not used outside of this file, so make it
static. This fixes the sparse warning:

drivers/resctrl/mpam_resctrl.c:25:1: warning: symbol 'resctrl_mon_ctx_waiters' was not declared. Should it be static?

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Closes: https://lore.kernel.org/oe-kbuild-all/202603281842.c2K96tJA-lkp@intel.com/
Fixes: 2a3c79c61539 ("arm_mpam: resctrl: Allow resctrl to allocate monitors")
Signed-off-by: Ben Horgan &lt;ben.horgan@arm.com&gt;
Reviewed-by: Gavin Shan &lt;gshan@redhat.com&gt;
Signed-off-by: James Morse &lt;james.morse@arm.com&gt;
</content>
</entry>
<entry>
<title>arm_mpam: resctrl: Fix the check for no monitor components found</title>
<updated>2026-04-17T16:48:07+00:00</updated>
<author>
<name>Ben Horgan</name>
<email>ben.horgan@arm.com</email>
</author>
<published>2026-04-14T13:27:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=67c0a487efa542cca9477ea84915db2e091f98d0'/>
<id>urn:sha1:67c0a487efa542cca9477ea84915db2e091f98d0</id>
<content type='text'>
Dan Carpenter reports that, in mpam_resctrl_alloc_domain(), any_mon_comp is
used in an 'if' condition when it may be uninitialized. Initialize it to
NULL so that the check behaves correctly when no monitor components are
found.

Reported-by: Dan Carpenter &lt;error27@gmail.com&gt;
Fixes: 264c285999fc ("arm_mpam: resctrl: Add monitor initialisation and domain boilerplate")
Signed-off-by: Ben Horgan &lt;ben.horgan@arm.com&gt;
Reviewed-by: Gavin Shan &lt;gshan@redhat.com&gt;
Signed-off-by: James Morse &lt;james.morse@arm.com&gt;
</content>
</entry>
<entry>
<title>arm_mpam: resctrl: Fix MBA CDP alloc_capable handling on unmount</title>
<updated>2026-04-17T16:43:57+00:00</updated>
<author>
<name>Zeng Heng</name>
<email>zengheng4@huawei.com</email>
</author>
<published>2026-04-13T09:00:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f758340da529ccb12531c3f83d5992e912f6c8d5'/>
<id>urn:sha1:f758340da529ccb12531c3f83d5992e912f6c8d5</id>
<content type='text'>
The code to set MBA's alloc_capable to true appears to be trying to
restore alloc_capable on unmount. This can never work because
resctrl_arch_set_cdp_enabled() is never invoked with RDT_RESOURCE_MBA
as the rid parameter. Consequently,
mpam_resctrl_controls[RDT_RESOURCE_MBA].cdp_enabled always remains false.

The alloc_capable setting in resctrl_arch_set_cdp_enabled() is to
re-enable MBA if the caller opts in to separate control values using
CDP for this resource. This doesn't happen today.

Add a comment to describe this.

However a bug remains where MBA allocation is permanently disabled after
the mount with CDP option. Remounting without CDP cannot restore the MBA
partition capability.

Add a check to re-enable MBA when CDP is disabled, which happens on
unmount.

Fixes: 6789fb99282c ("arm_mpam: resctrl: Add CDP emulation")
Signed-off-by: Zeng Heng &lt;zengheng4@huawei.com&gt;
[ morse: Added comment for existing code, added hunk to fix this bug from
  Ben H ]
Reviewed-by: James Morse &lt;james.morse@arm.com&gt;
Signed-off-by: James Morse &lt;james.morse@arm.com&gt;
</content>
</entry>
<entry>
<title>arm_mpam: resctrl: Call resctrl_init() on platforms that can support resctrl</title>
<updated>2026-03-27T15:32:19+00:00</updated>
<author>
<name>James Morse</name>
<email>james.morse@arm.com</email>
</author>
<published>2026-03-13T14:46:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fb481ec08699e9daf08ab839a79ab37b1bcca94d'/>
<id>urn:sha1:fb481ec08699e9daf08ab839a79ab37b1bcca94d</id>
<content type='text'>
Now that MPAM links against resctrl, call resctrl_init() to register the
filesystem and setup resctrl's structures.

Tested-by: Gavin Shan &lt;gshan@redhat.com&gt;
Tested-by: Shaopeng Tan &lt;tan.shaopeng@jp.fujitsu.com&gt;
Tested-by: Peter Newman &lt;peternewman@google.com&gt;
Tested-by: Zeng Heng &lt;zengheng4@huawei.com&gt;
Tested-by: Punit Agrawal &lt;punit.agrawal@oss.qualcomm.com&gt;
Tested-by: Jesse Chick &lt;jessechick@os.amperecomputing.com&gt;
Reviewed-by: Zeng Heng &lt;zengheng4@huawei.com&gt;
Reviewed-by: Shaopeng Tan &lt;tan.shaopeng@jp.fujitsu.com&gt;
Reviewed-by: Jonathan Cameron &lt;jonathan.cameron@huawei.com&gt;
Reviewed-by: Gavin Shan &lt;gshan@redhat.com&gt;
Co-developed-by: Ben Horgan &lt;ben.horgan@arm.com&gt;
Signed-off-by: Ben Horgan &lt;ben.horgan@arm.com&gt;
Signed-off-by: James Morse &lt;james.morse@arm.com&gt;
</content>
</entry>
<entry>
<title>arm_mpam: resctrl: Add empty definitions for assorted resctrl functions</title>
<updated>2026-03-27T15:32:04+00:00</updated>
<author>
<name>James Morse</name>
<email>james.morse@arm.com</email>
</author>
<published>2026-03-13T14:46:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=efc775eadce2c6e0921c21d9c29a7b6686022281'/>
<id>urn:sha1:efc775eadce2c6e0921c21d9c29a7b6686022281</id>
<content type='text'>
A few resctrl features and hooks need to be provided, but aren't needed or
supported on MPAM platforms.

resctrl has individual hooks to separately enable and disable the
closid/partid and rmid/pmg context switching code. For MPAM this is all the
same thing, as the value in struct task_struct is used to cache the value
that should be written to hardware. arm64's context switching code is
enabled once MPAM is usable, but doesn't touch the hardware unless the
value has changed.

For now event configuration is not supported, and can be turned off by
returning 'false' from resctrl_arch_is_evt_configurable().

The new io_alloc feature is not supported either, always return false from
the enable helper to indicate and fail the enable.

Add this, and empty definitions for the other hooks.

Tested-by: Gavin Shan &lt;gshan@redhat.com&gt;
Tested-by: Shaopeng Tan &lt;tan.shaopeng@jp.fujitsu.com&gt;
Tested-by: Peter Newman &lt;peternewman@google.com&gt;
Tested-by: Zeng Heng &lt;zengheng4@huawei.com&gt;
Tested-by: Punit Agrawal &lt;punit.agrawal@oss.qualcomm.com&gt;
Tested-by: Jesse Chick &lt;jessechick@os.amperecomputing.com&gt;
Reviewed-by: Zeng Heng &lt;zengheng4@huawei.com&gt;
Reviewed-by: Shaopeng Tan &lt;tan.shaopeng@jp.fujitsu.com&gt;
Reviewed-by: Jonathan Cameron &lt;jonathan.cameron@huawei.com&gt;
Reviewed-by: Gavin Shan &lt;gshan@redhat.com&gt;
Co-developed-by: Ben Horgan &lt;ben.horgan@arm.com&gt;
Signed-off-by: Ben Horgan &lt;ben.horgan@arm.com&gt;
Signed-off-by: James Morse &lt;james.morse@arm.com&gt;
</content>
</entry>
<entry>
<title>arm_mpam: resctrl: Update the rmid reallocation limit</title>
<updated>2026-03-27T15:31:57+00:00</updated>
<author>
<name>James Morse</name>
<email>james.morse@arm.com</email>
</author>
<published>2026-03-13T14:46:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=49b04e401825431529e866470d8d2dcd8e9ef058'/>
<id>urn:sha1:49b04e401825431529e866470d8d2dcd8e9ef058</id>
<content type='text'>
resctrl's limbo code needs to be told when the data left in a cache is
small enough for the partid+pmg value to be re-allocated.

x86 uses the cache size divided by the number of rmid users the cache may
have. Do the same, but for the smallest cache, and with the number of
partid-and-pmg users.

Tested-by: Gavin Shan &lt;gshan@redhat.com&gt;
Tested-by: Shaopeng Tan &lt;tan.shaopeng@jp.fujitsu.com&gt;
Tested-by: Peter Newman &lt;peternewman@google.com&gt;
Tested-by: Zeng Heng &lt;zengheng4@huawei.com&gt;
Tested-by: Punit Agrawal &lt;punit.agrawal@oss.qualcomm.com&gt;
Tested-by: Jesse Chick &lt;jessechick@os.amperecomputing.com&gt;
Reviewed-by: Zeng Heng &lt;zengheng4@huawei.com&gt;
Reviewed-by: Shaopeng Tan &lt;tan.shaopeng@jp.fujitsu.com&gt;
Reviewed-by: Jonathan Cameron &lt;jonathan.cameron@huawei.com&gt;
Reviewed-by: Gavin Shan &lt;gshan@redhat.com&gt;
Co-developed-by: Ben Horgan &lt;ben.horgan@arm.com&gt;
Signed-off-by: Ben Horgan &lt;ben.horgan@arm.com&gt;
Signed-off-by: James Morse &lt;james.morse@arm.com&gt;
</content>
</entry>
</feed>
