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

Luck, Tony posted 2 patches 2 years, 7 months ago
Only 0 patches received!
There is a newer version of this series
RE: [RFC PATCH 0/2] Resctrl - rewrite (WIP)
Posted by Luck, Tony 2 years, 7 months ago
>> By itself the core code is useless. Cannot even be built as the
>> controlling Kconfig option "CONFIG_RESCTRL2_FS" must be invoked by
>> a "select" request from architecture specific code that provides
>> the necessary "arch_*()" functions to make everything work.
>
> I would like to try to rebase the RISC-V CBQRI resctrl RFC [1] on top of
> this patch series instead of the mpam snapshot branch [2].

Thanks. That should help shake out any places where I've left in Intel-isms, or
my abstraction is insufficient to handle your architecture.

I've made some significant changes since I posted those patches. I pushed
the latest version to:

git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git    resctrl2_v64

> I had a patch in my RFC that added config option RISCV_ISA_SSQOSID which
> selects ARCH_HAS_CPU_RESCTRL and RESCTRL_FS [3]. It seems I would need
> to change that to select CONFIG_RESCTRL2_FS ?

Yes. Just have your architecture CONFIG option select RESCTRL2_FS

> A patch [4] in that RFC adds the "arch_*()" functions in
> arch/riscv/kernel/qos/qos_resctrl.c

Yes. This is an area that may need some tweaking to get the prototypes
for the arch_*() functions right.

I put all the x86 architecture code under fs/resctrl2/arch/x86/ .... mostly
so I can do quick test builds of both the common code and architecture
code with "make fs/resctrl2/" ... maybe in the end-game they should be
under arch/x86 rather than adding arch specific subdirs under generic
top-level directories (though I see a smattering of "x86" directories in
several places.

-Tony
Re: [RFC PATCH 0/2] Resctrl - rewrite (WIP)
Posted by Tony Luck 2 years, 7 months ago
On Tue, Jun 27, 2023 at 04:33:52PM +0000, Luck, Tony wrote:
> I've made some significant changes since I posted those patches. I pushed
> the latest version to:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git    resctrl2_v64

I just pushed one big commit with all the bits I've updated so far
this week. Fixes some serious issues as well as general cleanup.

HEAD is now:

afb7cdd4d640 resctrl2: Many cleanups, fixes, and new functionality

If you've started writing your own architecture specific modules there
are some small interface changes. Most should be found by the compiler
barfing, but the new ".reset()" resource function called during unmount
of /sys/fs/resctrl might be less obvious.

-Tony
Re: [RFC PATCH 0/2] Resctrl - rewrite (WIP)
Posted by Drew Fustini 2 years, 6 months ago
On Thu, Jun 29, 2023 at 05:06:45PM -0700, Tony Luck wrote:
> On Tue, Jun 27, 2023 at 04:33:52PM +0000, Luck, Tony wrote:
> > I've made some significant changes since I posted those patches. I pushed
> > the latest version to:
> > 
> > git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git    resctrl2_v64
> 
> I just pushed one big commit with all the bits I've updated so far
> this week. Fixes some serious issues as well as general cleanup.
> 
> HEAD is now:
> 
> afb7cdd4d640 resctrl2: Many cleanups, fixes, and new functionality
> 
> If you've started writing your own architecture specific modules there
> are some small interface changes. Most should be found by the compiler
> barfing, but the new ".reset()" resource function called during unmount
> of /sys/fs/resctrl might be less obvious.
> 
> -Tony

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?

Also, is resctrl2_v65rc1 the latest to branch to test?

Thank you,
Drew
Re: [RFC PATCH 0/2] Resctrl - rewrite (WIP)
Posted by Tony Luck 2 years, 6 months ago
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
Re: [RFC PATCH 0/2] Resctrl - rewrite (WIP)
Posted by Tony Luck 2 years, 6 months ago
On Wed, Jul 26, 2023 at 06:52:48AM -0700, Tony Luck wrote:
> On Tue, Jul 25, 2023 at 07:27:25PM -0700, Drew Fustini wrote:
> > 
> > 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).

Updated version available at:

git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git

Branch: resctrl2_v65rc4

Some minor fixes to core code, also changes to support pseudo-locking
(core code for the "mode" file plus some new functions in the resource
structure to call into modules to support this).

-Tony