Re: [RFC PATCH 0/2] Resctrl - rewrite (WIP)

From: Tony Luck
Date: Wed Jul 26 2023 - 09:53:18 EST


On Tue, Jul 25, 2023 at 07:27:25PM -0700, Drew Fustini wrote:
> I have access to a Xeon Silver 4310 machine which reports to have
> cat_l3, cqm_mbm_local, cqm_mbm_total and mba.
>
> I would like to test resctrl2 on it so I can better understand how it
> works. I think that will help me understand how to adapt the RISC-V
> CBQRI resctrl proof-of-concept to use resctrl2.
>
> Would you be able to provide an example of how you loaded the necessary
> resctrl2 kernel modules?

Drew,

Sure. You simply mount the filesystem, and then load modules for
whichever features you'd like to use. This will enable everything
you list above:

# mount -t resctrl resctrl /sys/fs/resctrl
# modprobe rdt_l3_cat
# modprobe rdt_llc_occupancy
# modprobe rdt_mbm_local_bytes
# modprobe rdt_mbm_total_bytes
# modprobe rdt_l3_mba

There are some experimental extras. E.g.

# modprobe rdt_mbm_total_rate
# modprobe rdt_mbm_local_rate

Will each add an extra file to the mon_data directories to
report the data rate in MB/s. The value reported is calculated
by the once-per-second counter roll-over code in the kernel.
So it might be up to one second out of date, but it is very cheap
to read since it doesn't involve MSR access (or cross processor
interrupts if you are reading from a CPU in a different scope).

You can unload modules without unmounting the filesystem and
load different ones to get different data/control. E.g. to
switch from L3CAT to L3CDP (which you don't list as supported,
so this may not work for you:

# rmmod rdt_l3_cat
# modprobe rdt_l3_cdp

Or to switch from the default MBA that uses percentages to
specify throttling to the MBM->MBA feedback code that uses
MB/s in the schemata file:

# rmmod rdt_l3_mba
# modprobe rdt_l3_mba_MBps
>
> Also, is resctrl2_v65rc1 the latest to branch to test?

Yes. That's the latest. There haven't been any updates for a
few days because I'm working on a module to support pseudo-locking.
I'm half-way there (can do most of the bits to set a group into
pseudo-locked mode ... about to work on the cleanup when the
group is removed, the filesystem unmounted, or the module unloaded).

-Tony