Skip to contentSkip to conversation

io_wq_worker_wake() calls ttwu() twice if TIF_NOTIFY_SIGNAL is not set

DISCUSSION Oleg Nesterov 1 participant 1 message Sep 27 io_uring

lore
Share & tools
lore
#0 lore raw

I can't understand what this trivial helper is trying to do.

Does it really need to set TIF_NOTIFY_SIGNAL and do the unconditonal wakeup including TASK_UNINTERRUPTIBLE? In this case in can just do

	static bool io_wq_worker_wake(struct io_worker *worker, void *data)
	{
		set_tsk_thread_flag(worker->task, TIF_NOTIFY_SIGNAL);
		wake_up_process(worker->task);
		return false;
	}

Or may be it can rely on __set_notify_signal() which does wake_up_state(TASK_INTERRUPTIBLE) if TIF_NOTIFY_SIGNAL is not set? Then wake_up_process() should be removed.

Confused ;)

Oleg.