Skip to content

Commit 79c5379

Browse files
stablebitsIngo Molnar
authored andcommitted
sched: fix cpu hotplug
the CPU hotplug problems (crashes under high-volume unplug+replug tests) seem to be related to migrate_dead_tasks(). Firstly I added traces to see all tasks being migrated with migrate_live_tasks() and migrate_dead_tasks(). On my setup the problem pops up (the one with "se == NULL" in the loop of pick_next_task_fair()) shortly after the traces indicate that some has been migrated with migrate_dead_tasks()). btw., I can reproduce it much faster now with just a plain cpu down/up loop. [disclaimer] Well, unless I'm really missing something important in this late hour [/desclaimer] pick_next_task() is not something appropriate for migrate_dead_tasks() :-) the following change seems to eliminate the problem on my setup (although, I kept it running only for a few minutes to get a few messages indicating migrate_dead_tasks() does move tasks and the system is still ok) Signed-off-by: Ingo Molnar <[email protected]>
1 parent 543cf4c commit 79c5379

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/sched.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5887,6 +5887,7 @@ static void migrate_dead_tasks(unsigned int dead_cpu)
58875887
next = pick_next_task(rq, rq->curr);
58885888
if (!next)
58895889
break;
5890+
next->sched_class->put_prev_task(rq, next);
58905891
migrate_dead(dead_cpu, next);
58915892

58925893
}

0 commit comments

Comments
 (0)