x86/resctrl: Track the number of dirty RMID a CLOSID has
authorJames Morse <james.morse@arm.com>
Tue, 13 Feb 2024 18:44:22 +0000 (18:44 +0000)
committerBorislav Petkov (AMD) <bp@alien8.de>
Fri, 16 Feb 2024 18:18:31 +0000 (19:18 +0100)
commitb30a55df60c35df09b9ef08dfb0a0cbb543abe81
tree4716815b28aeb7027ae207522a6c719d9107b493
parentc4c0376eefe185b790d89ca8016b7f837ebf25da
x86/resctrl: Track the number of dirty RMID a CLOSID has

MPAM's PMG bits extend its PARTID space, meaning the same PMG value can be
used for different control groups.

This means once a CLOSID is allocated, all its monitoring ids may still be
dirty, and held in limbo.

Keep track of the number of RMID held in limbo each CLOSID has. This will
allow a future helper to find the 'cleanest' CLOSID when allocating.

The array is only needed when CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID is
defined. This will never be the case on x86.

Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Shaopeng Tan <tan.shaopeng@fujitsu.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Reviewed-by: Babu Moger <babu.moger@amd.com>
Tested-by: Shaopeng Tan <tan.shaopeng@fujitsu.com>
Tested-by: Peter Newman <peternewman@google.com>
Tested-by: Babu Moger <babu.moger@amd.com>
Tested-by: Carl Worth <carl@os.amperecomputing.com> # arm64
Link: https://lore.kernel.org/r/20240213184438.16675-9-james.morse@arm.com
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
arch/x86/kernel/cpu/resctrl/monitor.c