diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2021-03-10 13:13:55 +0000 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-04-11 17:41:58 -0600 |
commit | c9dca27dc7f9c5dc4ee4ba5b77f7584387f867fe (patch) | |
tree | faaea1901f35d7978cec23df6b269883e41ac763 /fs/io_uring.c | |
parent | abc54d634334f24d9a3253b8207b42eda852f25a (diff) | |
download | lwn-c9dca27dc7f9c5dc4ee4ba5b77f7584387f867fe.tar.gz lwn-c9dca27dc7f9c5dc4ee4ba5b77f7584387f867fe.zip |
io_uring: simplify io_sqd_update_thread_idle()
Use a more comprehensible() max instead of hand coding it with ifs in
io_sqd_update_thread_idle().
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r-- | fs/io_uring.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 094f869674b3..d5ef9560449b 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -6699,11 +6699,8 @@ static void io_sqd_update_thread_idle(struct io_sq_data *sqd) struct io_ring_ctx *ctx; unsigned sq_thread_idle = 0; - list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) { - if (sq_thread_idle < ctx->sq_thread_idle) - sq_thread_idle = ctx->sq_thread_idle; - } - + list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) + sq_thread_idle = max(sq_thread_idle, ctx->sq_thread_idle); sqd->sq_thread_idle = sq_thread_idle; } |