sched,livepatch: Use wake_up_if_idle()
Make sure to prod idle CPUs so they call klp_update_patch_state(). Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Petr Mladek <pmladek@suse.com> Acked-by: Miroslav Benes <mbenes@suse.cz> Acked-by: Vasily Gorbik <gor@linux.ibm.com> Tested-by: Petr Mladek <pmladek@suse.com> Tested-by: Vasily Gorbik <gor@linux.ibm.com> # on s390 Link: https://lkml.kernel.org/r/20210929151723.162004989@infradead.org
This commit is contained in:
@@ -11,7 +11,11 @@ enum cpu_idle_type {
|
|||||||
CPU_MAX_IDLE_TYPES
|
CPU_MAX_IDLE_TYPES
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef CONFIG_SMP
|
||||||
extern void wake_up_if_idle(int cpu);
|
extern void wake_up_if_idle(int cpu);
|
||||||
|
#else
|
||||||
|
static inline void wake_up_if_idle(int cpu) { }
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Idle thread specific functions to determine the need_resched
|
* Idle thread specific functions to determine the need_resched
|
||||||
|
|||||||
@@ -413,8 +413,11 @@ void klp_try_complete_transition(void)
|
|||||||
for_each_possible_cpu(cpu) {
|
for_each_possible_cpu(cpu) {
|
||||||
task = idle_task(cpu);
|
task = idle_task(cpu);
|
||||||
if (cpu_online(cpu)) {
|
if (cpu_online(cpu)) {
|
||||||
if (!klp_try_switch_task(task))
|
if (!klp_try_switch_task(task)) {
|
||||||
complete = false;
|
complete = false;
|
||||||
|
/* Make idle task go through the main loop. */
|
||||||
|
wake_up_if_idle(cpu);
|
||||||
|
}
|
||||||
} else if (task->patch_state != klp_target_state) {
|
} else if (task->patch_state != klp_target_state) {
|
||||||
/* offline idle tasks can be switched immediately */
|
/* offline idle tasks can be switched immediately */
|
||||||
clear_tsk_thread_flag(task, TIF_PATCH_PENDING);
|
clear_tsk_thread_flag(task, TIF_PATCH_PENDING);
|
||||||
|
|||||||
Reference in New Issue
Block a user