io_uring: add reschedule point to handle_tw_list()
Commit f586800854 upstream.
If CONFIG_PREEMPT_NONE is set and the task_work chains are long, we
could be running into issues blocking others for too long. Add a
reschedule check in handle_tw_list(), and flush the ctx if we need to
reschedule.
Cc: stable@vger.kernel.org # 5.10+
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
297883bbca
commit
dc4a25fa75
+5
-2
@@ -2214,9 +2214,12 @@ static void tctx_task_work(struct callback_head *cb)
|
|||||||
}
|
}
|
||||||
req->io_task_work.func(req, &locked);
|
req->io_task_work.func(req, &locked);
|
||||||
node = next;
|
node = next;
|
||||||
|
if (unlikely(need_resched())) {
|
||||||
|
ctx_flush_and_put(ctx, &locked);
|
||||||
|
ctx = NULL;
|
||||||
|
cond_resched();
|
||||||
|
}
|
||||||
} while (node);
|
} while (node);
|
||||||
|
|
||||||
cond_resched();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx_flush_and_put(ctx, &locked);
|
ctx_flush_and_put(ctx, &locked);
|
||||||
|
|||||||
Reference in New Issue
Block a user