Commit a147ce14 authored by James Morse's avatar James Morse Committed by Zeng Heng
Browse files

x86/resctrl: Add a helper to avoid reaching into the arch code resource list

maillist inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8T2RT

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git/log/?h=mpam/snapshot/v6.7-rc2



---------------------------

Resctrl occasionally wants to know something about a specific resource.
It reaches into the arch code's rdt_resources_all.

Once the filesystem parts of resctrl are moved to /fs/, this means it
will need visibility of the architecture specific structure.

Move the level enum to the resctrl header and add a helper to retrieve
the resctrl struct by id. resctrl_arch_get_resource() should not return
NULL for any value in the enum, it may instead return a dummy resource
that is !alloc_enabled && !mon_enabled.

Signed-off-by: default avatarJames Morse <james.morse@arm.com>
Signed-off-by: default avatarZeng Heng <zengheng4@huawei.com>
parent 63d5f97c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment