Thread (200 messages) 200 messages, 10 authors, 2025-09-10

Re: [PATCH 02/33] drivers: base: cacheinfo: Add helper to find the cache size from cpu+level

From: Dave Martin <Dave.Martin@arm.com>
Date: 2025-09-05 16:19:48
Also in: linux-acpi, linux-devicetree, lkml

Hi,

On Wed, Aug 27, 2025 at 06:11:43PM +0100, James Morse wrote:
Hi Dave,

On 27/08/2025 11:46, Dave Martin wrote:
quoted
Hi,

On Fri, Aug 22, 2025 at 03:29:43PM +0000, James Morse wrote:
quoted
MPAM needs to know the size of a cache associated with a particular CPU.
The DT/ACPI agnostic way of doing this is to ask cacheinfo.

Add a helper to do this.
quoted
quoted
diff --git a/include/linux/cacheinfo.h b/include/linux/cacheinfo.h
[...]
quoted
quoted
+static inline unsigned int get_cpu_cacheinfo_size(int cpu, int level)
+{
+	struct cacheinfo *ci = get_cpu_cacheinfo_level(cpu, level);
+
+	return ci ? ci->size : 0;
+}
+
Orphaned function?

Can fs/resctrl/rdtgroup.c:rdtgroup_cbm_to_size() be ported to use this?
If so, this wouldn't just be dead code in this series.
Ah - I thought the MPAM driver was pulling this value in, but its the resctrl glue code.
I was trying to reduce the number of trees this touches - its probably best to kick this
into the next series that adds the resctrl code as its pretty trivial.


Thanks,

James
Fair enough.

Cheers
---Dave
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help