Commit 792d1aeb authored by zhangwei123171's avatar zhangwei123171
Browse files

sched/fair: Remove invalid cpu selection logic in dynamic affinity

jingdong inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8E8DQ



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

The CPU selected by  select_task_rq_fair may not be
in the corresponding cpuset. This will be corrected
in the subsequent fallback process.

dynamic affinity should not break this logic.

Fixes: 2a3bb3c0 ("sched: Adjust wakeup cpu range according CPU util dynamicly")
Signed-off-by: default avatarzhangwei123171 <zhangwei123171@jd.com>
Reviewed-by: default avatarzhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
parent 6525d74d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -7413,7 +7413,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f
	int ret;
#endif
#ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY
	int idlest_cpu = 0;
	int idlest_cpu = -1;
#endif

	time = schedstat_start_time();
@@ -7526,7 +7526,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f
	rcu_read_unlock();

#ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY
	if (!cpumask_test_cpu(new_cpu, p->select_cpus)) {
	if (idlest_cpu != -1 && !cpumask_test_cpu(new_cpu, p->select_cpus)) {
		new_cpu = idlest_cpu;
		schedstat_inc(p->se.statistics.nr_wakeups_force_preferred_cpus);
	}