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

x86/resctrl: Add helper for setting CPU default properties

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



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

rdtgroup_rmdir_ctrl() and rdtgroup_rmdir_mon() set the per-cpu
pqr_state for CPUs that were part of the rmdir'd group.

Another architecture might not have a 'pqr_state', its hardware may
need the values in a different format. MPAM's equivalent of RMID values
are not unique, and always need the CLOSID to be provided too.

As only rdtgroup_rmdir_mon() modifies just the RMID, provide a helper
that sets both values. This allows another architecture to convert
the values into the format the hardware expects.
As these values are read by __resctrl_sched_in(), but may be written by
a different CPU without any locking, add READ/WRTE_ONCE() to avoid torn
values.

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