diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2021-10-21 13:20:29 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-10-21 11:19:38 -0600 |
commit | b22fa62a35d7f2029d757a518d78041822b7c7c1 (patch) | |
tree | 610af96d64a830b4b5fae86a0f4cffd692a85ad8 /tools/accounting | |
parent | 4ea672ab694c23886b52e97cee10dea056e43e62 (diff) | |
download | lwn-b22fa62a35d7f2029d757a518d78041822b7c7c1.tar.gz lwn-b22fa62a35d7f2029d757a518d78041822b7c7c1.zip |
io_uring: apply worker limits to previous users
Another change to the API io-wq worker limitation API added in 5.15,
apply the limit to all prior users that already registered a tctx. It
may be confusing as it's now, in particular the change covers the
following 2 cases:
TASK1 | TASK2
_________________________________________________
ring = create() |
| limit_iowq_workers()
*not limited* |
TASK1 | TASK2
_________________________________________________
ring = create() |
| issue_requests()
limit_iowq_workers() |
| *not limited*
A note on locking, it's safe to traverse ->tctx_list as we hold
->uring_lock, but do that after dropping sqd->lock to avoid possible
problems. It's also safe to access tctx->io_wq there because tasks
kill it only after removing themselves from tctx_list, see
io_uring_cancel_generic() -> io_uring_clean_tctx()
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/d6e09ecc3545e4dc56e43c906ee3d71b7ae21bed.1634818641.git.asml.silence@gmail.com
Reviewed-by: Hao Xu <haoxu@linux.alibaba.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'tools/accounting')
0 files changed, 0 insertions, 0 deletions