From: Andrea Righi <arighi@nvidia.com> mainline inclusion from mainline-v6.14-rc1 commit 9cf9aceed21e3f08c94108bd688e812effce4423 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IDC9YK Reference: https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commi... -------------------------------- Use the assign_cpu() helper to set or clear the CPU in the idle mask, based on the idle condition. Acked-by: Yury Norov <yury.norov@gmail.com> Signed-off-by: Andrea Righi <arighi@nvidia.com> Signed-off-by: Tejun Heo <tj@kernel.org> Conflicts: kernel/sched/ext.c [Only pick the part modified by this mainline commit, and ignore the conflict part caused by higher version.] Signed-off-by: Zicheng Qu <quzicheng@huawei.com> --- kernel/sched/ext.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c index 4e8ef61b117e..d48a76c690e0 100644 --- a/kernel/sched/ext.c +++ b/kernel/sched/ext.c @@ -3659,10 +3659,7 @@ static void reset_idle_masks(void) static void update_builtin_idle(int cpu, bool idle) { - if (idle) - cpumask_set_cpu(cpu, idle_masks.cpu); - else - cpumask_clear_cpu(cpu, idle_masks.cpu); + assign_cpu(cpu, idle_masks.cpu, idle); #ifdef CONFIG_SCHED_SMT if (sched_smt_active()) { -- 2.34.1