commit | 8751d15426a31baaf40f7570263c27c3e5d1dc44 | [log] [tgz] |
---|---|---|
author | Pavel Begunkov <[email protected]> | Thu Apr 06 14:20:12 2023 +0100 |
committer | Jens Axboe <[email protected]> | Thu Apr 06 16:23:28 2023 -0600 |
tree | ce78034f5b032052374c63e97c403143511365a2 | |
parent | 5150940079a3ce94d7474f6f5b0d6276569dc1de [diff] |
io_uring: reduce scheduling due to tw Every task_work will try to wake the task to be executed, which causes excessive scheduling and additional overhead. For some tw it's justified, but others won't do much but post a single CQE. When a task waits for multiple cqes, every such task_work will wake it up. Instead, the task may give a hint about how many cqes it waits for, io_req_local_work_add() will compare against it and skip wake ups if #cqes + #tw is not enough to satisfy the waiting condition. Task_work that uses the optimisation should be simple enough and never post more than one CQE. It's also ignored for non DEFER_TASKRUN rings. Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/d2b77e99d1e86624d8a69f7037d764b739dcd225.1680782017.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>