We switched the hotplug machinery to smpboot threads. Early registration of hotplug callbacks, i.e. from do_pre_smp_initcalls(), happens before the threads are initialized. Instead of moving the thread init, we simply handle it in the hotplug code itself and invoke the function directly.
Showing the changes to kernel/cpu.c (1 of 1 file). Show all
Unified · Split
| @@ -517,6 +517,13 @@ static int cpuhp_invoke_ap_callback(int cpu, enum cpuhp_state state, · 516 unmodified lines | ||
| 517 | 517 | if (!cpu_online(cpu)) |
| 518 | 518 | return 0; |
| 519 | 519 | |
| 520 | + /* | |
| 521 | + * If we are up and running, use the hotplug thread. For early calls | |
| 522 | + * we invoke the thread function directly. | |
| 523 | + */ | |
| 524 | + if (!st->thread) | |
| 525 | + return cpuhp_invoke_callback(cpu, state, cb); | |
| 526 | + | |
| 520 | 527 | st->cb_state = state; |
| 521 | 528 | st->cb = cb; |
| 522 | 529 | /* |