All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] io_uring: honour zeroes as io-wq worker limits
@ 2021-11-08 15:10 Pavel Begunkov
  2021-11-08 15:39 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2021-11-08 15:10 UTC (permalink / raw)
  To: io-uring; +Cc: Jens Axboe, asml.silence, Beld Zhang

When we pass in zero as an io-wq worker number limit it shouldn't
actually change the limits but return the old value, follow that
behaviour with deferred limits setup as well.

Cc: stable@kernel.org # 5.15
Reported-by: Beld Zhang <beldzhang@gmail.com>
Fixes: e139a1ec92f8d ("io_uring: apply max_workers limit to all future users")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 fs/io_uring.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index ac1bc8ac4666..b07196b4511c 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -10791,7 +10791,9 @@ static __cold int io_register_iowq_max_workers(struct io_ring_ctx *ctx,
 
 	BUILD_BUG_ON(sizeof(new_count) != sizeof(ctx->iowq_limits));
 
-	memcpy(ctx->iowq_limits, new_count, sizeof(new_count));
+	for (i = 0; i < ARRAY_SIZE(new_count); i++)
+		if (new_count[i])
+			ctx->iowq_limits[i] = new_count[i];
 	ctx->iowq_limits_set = true;
 
 	if (tctx && tctx->io_wq) {
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] io_uring: honour zeroes as io-wq worker limits
  2021-11-08 15:10 [PATCH 1/1] io_uring: honour zeroes as io-wq worker limits Pavel Begunkov
@ 2021-11-08 15:39 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-11-08 15:39 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring; +Cc: Beld Zhang

On Mon, 8 Nov 2021 15:10:03 +0000, Pavel Begunkov wrote:
> When we pass in zero as an io-wq worker number limit it shouldn't
> actually change the limits but return the old value, follow that
> behaviour with deferred limits setup as well.
> 
> 

Applied, thanks!

[1/1] io_uring: honour zeroes as io-wq worker limits
      commit: bad119b9a00019054f0c9e2045f312ed63ace4f4

Best regards,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-08 15:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 15:10 [PATCH 1/1] io_uring: honour zeroes as io-wq worker limits Pavel Begunkov
2021-11-08 15:39 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.