History

sched/fair: Avoid a second scan of target in select_idle_cpu

When select_idle_cpu starts scanning for an idle CPU, it starts with a target CPU that has already been checked by select_idle_sibling. This patch starts with the next CPU instead.

Mel Gorman committed 5 years ago

Commit 56498cf1 parent 89aafd61 file · +1 −1Browse files

Unified · Split

kernel/sched/fair.c+1−1
@@ -6220,7 +6220,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, bool · 6219 unmodified lines
6220 time = cpu_clock(this);6220 time = cpu_clock(this);
6221 }6221 }
6222 6222
6223 for_each_cpu_wrap(cpu, cpus, target) {6223 for_each_cpu_wrap(cpu, cpus, target + 1) {
6224 if (has_idle_core) {6224 if (has_idle_core) {
6225 i = select_idle_core(p, cpu, cpus, &idle_cpu);6225 i = select_idle_core(p, cpu, cpus, &idle_cpu);
6226 if ((unsigned int)i < nr_cpumask_bits)6226 if ((unsigned int)i < nr_cpumask_bits)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t