# Re: \[RFC\]\[PATCH 5/7\] sched,livepatch: Use wake\_up\_if\_idle()

- From: Miroslav Benes \<mbenes@suse.cz\>
- Date: 2021-09-22 13:05:07 
- List: live-patching
- Page: https://ratatoskr.run/live-patching/2021/09/1518317
- Thread: https://ratatoskr.run/live-patching/2021/09/1518181/t.md

```text
> @@ -405,8 +405,10 @@ void klp_try_complete_transition(void)
>  	for_each_possible_cpu(cpu) {
>  		task = idle_task(cpu);
>  		if (cpu_online(cpu)) {
> -			if (!klp_try_switch_task(task))
> -				complete = false;
> +			int ret = klp_try_switch_task(task);
> +			if (ret == -EBUSY)
> +				wake_up_if_idle(cpu);
> +			complete = !ret;

This is broken. You can basically change "complete" only to false (when it 
applies). This could leave some tasks in the old patching state.

Anyway, I like the patch set a lot. It moves our infrastructure to a 
proper (I hope so) API and it removes few quirks we have along the way. 
I'll play with it some more.

Thanks

Miroslav
```
