
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ICO2ME -------------------------------- Under CDP mode, MPAM uses different PartIDs to track CPU instruction-port and data-port memory-access requests. In practice, to prevent tasks switching their PartIDs too frequently, the root directory group’s default mpam_partid_pmg remains 0, rather than 1, under CDP mode. Accordingly, mpam_thread_switch() must check the task’s mpam_partid_pmg against 0 instead of against mpam_resctrl_default_group; otherwise, in CDP mode the scheduler will fail to switch to the partid that corresponds to CPU. Fixes: 5cd0dad659e8 ("arm64: mpam: Context switch the MPAM registers") Signed-off-by: Zeng Heng <zengheng4@huawei.com> --- arch/arm64/include/asm/mpam.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/mpam.h b/arch/arm64/include/asm/mpam.h index 9abe1fe58c34..8caac70e22ed 100644 --- a/arch/arm64/include/asm/mpam.h +++ b/arch/arm64/include/asm/mpam.h @@ -153,7 +153,7 @@ static inline void mpam_thread_switch(struct task_struct *tsk) !static_branch_likely(&mpam_enabled)) return; - if (regval == READ_ONCE(mpam_resctrl_default_group)) + if (!regval) regval = READ_ONCE(per_cpu(arm64_mpam_default, cpu)); oldregval = READ_ONCE(per_cpu(arm64_mpam_current, cpu)); -- 2.25.1