public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Liu Xiaodong <xiaodong.liu@intel.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jim Harris <james.r.harris@intel.com>,
	Ziyang Zhang <ZiyangZhang@linux.alibaba.com>
Subject: Re: [PATCH] block: ublk: check IO buffer based on flag need_get_data
Date: Mon, 13 Feb 2023 10:37:32 +0800	[thread overview]
Message-ID: <Y+mibLjCjiDXoPRt@T590> (raw)
In-Reply-To: <20230210141356.112321-1-xiaodong.liu@intel.com>

On Fri, Feb 10, 2023 at 09:13:56AM -0500, Liu Xiaodong wrote:
> Currently, uring_cmd with UBLK_IO_FETCH_REQ or
> UBLK_IO_COMMIT_AND_FETCH_REQ is always checked whether
> userspace server has provided IO buffer even flag
> UBLK_F_NEED_GET_DATA is configured.
> 
> This is a excessive check. If UBLK_F_NEED_GET_DATA is
> configured, FETCH_RQ doesn't need to provide IO buffer;
> COMMIT_AND_FETCH_REQ also doesn't need to do that if
> the IO type is not READ.
> 
> Check ub_cmd->addr together with ublk_need_get_data()
> and IO type in ublk_ch_uring_cmd().
> 
> With this fix, userspace server doesn't need to preserve
> buffers for every ublk_io when flag UBLK_F_NEED_GET_DATA
> is configured, in order to save memory.
> 
> Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>

Good catch!

Fixes: c86019ff75c1 ("ublk_drv: add support for UBLK_IO_NEED_GET_DATA")
Reviewed-by: Ming Lei <ming.lei@redhat.com>

Thanks,
Ming


  reply	other threads:[~2023-02-13  2:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10 14:13 [PATCH] block: ublk: check IO buffer based on flag need_get_data Liu Xiaodong
2023-02-13  2:37 ` Ming Lei [this message]
2023-02-13 15:36 ` 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=Y+mibLjCjiDXoPRt@T590 \
    --to=ming.lei@redhat.com \
    --cc=ZiyangZhang@linux.alibaba.com \
    --cc=axboe@kernel.dk \
    --cc=james.r.harris@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiaodong.liu@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox