Re: [PATCH v19 16/20] x86/resctrl: Make resctrl_arch_rmid_read() handle sum over domains

From: Reinette Chatre
Date: Fri Jun 07 2024 - 12:49:52 EST


Hi Tony,

On 6/3/24 4:15 PM, Tony Luck wrote:
On Thu, May 30, 2024 at 01:24:57PM -0700, Reinette Chatre wrote:
On 5/28/24 3:20 PM, Tony Luck wrote:
...

+
+ return 0;
+}
+
+int resctrl_arch_rmid_read(struct rdt_resource *r, struct rdt_mon_domain *d,
+ u32 unused, u32 rmid, enum resctrl_event_id eventid,
+ u64 *val, bool sum, struct cacheinfo *ci, void *ignored)

This is not architecture specific code.

Can you explain further? I've dropped the "sum" argument. As you pointed
out elsewhere this can be inferred from "d == NULL". But I do need the
cacheinfo information in resctrl_arch_rmid_read() to:
1) determine which domains to sum (those that match ci->id).
2) sanity check code is executing on a CPU in ci->shared_cpu_map.


"resctrl_arch_*" is the prefix of functions needed to be implemented
by every architecture. As I understand there is nothing architecture
specific about what this function does and every architecture's function
would thus end up looking identical. I expected the cacheinfo
information to be available from all architectures. If this is not
the case then it does not belong in struct rdt_mon_domain but should
instead be moved to struct rdt_hw_mon_domain ... but since cacheinfo
has already made its way into the filesystem code it is not clear
to me how you envision the arch/fs split.

Reinette