On Sat, 10 Jan 2026 23:33:47 +0900
"Masami Hiramatsu (Google)" <[email protected]> wrote:
> +static int kprobe_optimizer_thread(void *data)
> +{
> + set_freezable();
Steve pointed that the kthread usually don't need to be freezable and
the workqueue is not freezable too. So I decided to remove this.
> + while (!kthread_should_stop()) {
> + wait_event_freezable(kprobe_optimizer_wait,
> + atomic_read(&optimizer_state) !=
> OPTIMIZER_ST_IDLE ||
> + kthread_should_stop());
> +
> + if (kthread_should_stop())
> + break;
> +
> + if (try_to_freeze())
> + continue;
> +
> + /*
> + * If it was a normal kick, wait for OPTIMIZE_DELAY.
> + * This wait can be interrupted by a flush request.
> + */
> + if (atomic_read(&optimizer_state) == 1)
> + wait_event_freezable_timeout(kprobe_optimizer_wait,
> + atomic_read(&optimizer_state) ==
> OPTIMIZER_ST_FLUSHING ||
> + kthread_should_stop(),
> + OPTIMIZE_DELAY);
Also, forgot to add kthread_should_stop() check here.
Let me update to v2.
Thanks,
--
Masami Hiramatsu (Google) <[email protected]>