Commit c9dca27d authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe
Browse files

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: default avatarPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent abc54d63
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -6699,11 +6699,8 @@ static void io_sqd_update_thread_idle(struct io_sq_data *sqd)
	struct io_ring_ctx *ctx;
	struct io_ring_ctx *ctx;
	unsigned sq_thread_idle = 0;
	unsigned sq_thread_idle = 0;


	list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
	list_for_each_entry(ctx, &sqd->ctx_list, sqd_list)
		if (sq_thread_idle < ctx->sq_thread_idle)
		sq_thread_idle = max(sq_thread_idle, ctx->sq_thread_idle);
			sq_thread_idle = ctx->sq_thread_idle;
	}

	sqd->sq_thread_idle = sq_thread_idle;
	sqd->sq_thread_idle = sq_thread_idle;
}
}