Commit 94890078 authored by Jens Axboe's avatar Jens Axboe Committed by Akilesh Kailash
Browse files

BACKPORT: io_uring: fix task_work cap overshooting



A previous commit fixed task_work overrunning by a lot more than what
the user asked for, by adding a retry list. However, it didn't cap the
overall count, hence for multiple task_work runs inside the same wait
loop, it'd still overshoot the target by potentially a large amount.

Cap it generally inside the wait path. Note that this will still
overshoot the default limit of 20, but should overshoot by no more than
limit-1 in addition to the limit. That still provides a ceiling over how
much task_work will be run, rather than still having gaps where it was
uncapped essentially.

Bug: 450109138
Bug: 297114355
(cherry picked from commit 49c5c63d)
Fixes: f46b9cdb ("io_uring: limit local tw done")
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarAkilesh Kailash <akailash@google.com>
[akailash@: Fix merge conflict in io_run_local_work()]
Cherrypick-From: https://android-review.googlesource.com/q/commit:7b48db36460c087dd32098c0845108324c6f3285


Merged-In: I3af238b295497942ac50ad68a64aa50a91227219
Change-Id: I3af238b295497942ac50ad68a64aa50a91227219
Signed-off-by: default avatarAkilesh Kailash <akailash@google.com>
parent 98351def
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment