Same kind of optimization we have for the JOBCTL_TASK_WORK. This is safe
to do, as we're running task_work manually for this case.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
if (io_run_task_work())
continue;
if (signal_pending(current)) {
+ /* avoid restart, if we can */
+#ifdef TIF_NOTIFY_SIGNAL
+ if (test_and_clear_thread_flag(TIF_NOTIFY_SIGNAL))
+ continue;
+#endif
if (current->jobctl & JOBCTL_TASK_WORK) {
spin_lock_irq(¤t->sighand->siglock);
current->jobctl &= ~JOBCTL_TASK_WORK;