Commit 2a80d5a1 authored by zhangwei123171's avatar zhangwei123171 Committed by Hui Tang
Browse files

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

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



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

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: f6cee1481527 ("sched: Adjust wakeup cpu range according CPU util dynamicly")
Signed-off-by: default avatarzhangwei123171 <zhangwei123171@jd.com>
Signed-off-by: default avatarHui Tang <tanghui20@huawei.com>
parent c6d0131f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -8239,7 +8239,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
	/* SD_flags and WF_flags share the first nibble */
	int sd_flag = wake_flags & 0xF;
#ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY
	int idlest_cpu = 0;
	int idlest_cpu = -1;
#endif

	/*
@@ -8314,7 +8314,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
	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->stats.nr_wakeups_force_preferred_cpus);
	}