All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH] ublk_drv: set DMA alignment mask to 3
Date: Sat, 11 May 2024 23:04:37 +0800	[thread overview]
Message-ID: <Zj+JBbODPDh/v3vK@fedora> (raw)
In-Reply-To: <379b841f-210f-41dc-a44c-f1dc3197e10f@kernel.dk>

On Sat, May 11, 2024 at 08:40:57AM -0600, Jens Axboe wrote:
> By default, this will be 511, as that's the block layer default. But
> drivers these days can support memory alignments that aren't tied to
> the sector sizes, instead just being limited by what the DMA engine
> supports. An example is NVMe, where it's generally set to a 32-bit or
> 64-bit boundary. As ublk itself doesn't really care, just set it low
> enough that we don't run into issues with NVMe where the required
> O_DIRECT memory alignment is now more restrictive on ublk than it is
> on the underlying device.
> 
> This was triggered by spurious -EINVAL returns on O_DIRECT IO on a
> setup with ublk managing NVMe devices, which previously worked just
> fine on the NVMe device itself. With the alignment relaxed, the test
> works fine.
> 
> Signed-off-by: Jens Axboe <axboe@kernel.dk>

It should be triggered since DIO DMA alignment is relaxed:

Reviewed-by: Ming Lei <ming.lei@redhat.com>



Thanks, 
Ming


      reply	other threads:[~2024-05-11 15:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-11 14:40 [PATCH] ublk_drv: set DMA alignment mask to 3 Jens Axboe
2024-05-11 15:04 ` Ming Lei [this message]

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=Zj+JBbODPDh/v3vK@fedora \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    /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.