All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Jackie Liu <liuyun01@kylinos.cn>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org
Subject: Re: [PATCH] io_uring: ensure cq_entries is at least equal to or greater than sq_entries
Date: Wed, 23 Oct 2019 14:42:01 -0400	[thread overview]
Message-ID: <x49d0ennw1y.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <1571795864-56669-1-git-send-email-liuyun01@kylinos.cn> (Jackie Liu's message of "Wed, 23 Oct 2019 09:57:44 +0800")

Jackie Liu <liuyun01@kylinos.cn> writes:

> If cq_entries is smaller than sq_entries, it will cause a lot of overflow
> to appear. when customizing cq_entries, at least let him be no smaller than
> sq_entries.
>
> Fixes: 95d8765bd9f2 ("io_uring: allow application controlled CQ ring size")
> Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
> ---
>  fs/io_uring.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index b64cd2c..dfa9731 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -3784,7 +3784,7 @@ static int io_uring_create(unsigned entries, struct io_uring_params *p)
>  		 * to a power-of-two, if it isn't already. We do NOT impose
>  		 * any cq vs sq ring sizing.
>  		 */
> -		if (!p->cq_entries || p->cq_entries > IORING_MAX_CQ_ENTRIES)
> +		if (p->cq_entries < p->sq_entries || p->cq_entries > IORING_MAX_CQ_ENTRIES)

What if they're both zero?  I think you want to keep that check.

-Jeff


  reply	other threads:[~2019-10-23 18:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23  1:57 [PATCH] io_uring: ensure cq_entries is at least equal to or greater than sq_entries Jackie Liu
2019-10-23 18:42 ` Jeff Moyer [this message]
2019-10-23 19:41   ` Jens Axboe
2019-10-24  0:22     ` Jackie Liu
2019-10-24  3:26       ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=x49d0ennw1y.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=liuyun01@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.