All of lore.kernel.org
 help / color / mirror / Atom feed
From: axboe@kernel.dk (Jens Axboe)
Subject: Alignment Issue with Direct IO to NVMe Drive
Date: Tue, 27 Nov 2012 13:09:46 +0100	[thread overview]
Message-ID: <50B4AD8A.7020208@kernel.dk> (raw)
In-Reply-To: <CAMi7pMamJK079wQs+5Kaz=zdYGAPS+BFg2xCRKJMqPFMrQvQPQ@mail.gmail.com>

On 2012-11-27 01:35, Laine Walker-Avina wrote:
> Hi all,
> 
> We are experiencing an issue with doing direct IO to a NVMe device I'm
> helping to develop. Every so often, the physical address given by
> sg_dma_address() is aligned to 0x800 instead of 0x1000 as specified by
> blk_queue_dma_alignement(queue, 4095) when the queue is initialized.
> The request is also split over multiple segments to make up for the
> missing space (eg: for a 4k IO it's split into two segments 2k in
> size, and for an 8k IO it's split into 3 segments--2k,4k,2k). Our
> design requires the physical segments given to the device be aligned
> to 4k boundaries and be multiples of 4k in size. When not doing direct
> IO the physical addresses appear to always be 4k aligned as expected.
> One possible issue is the kernel we're primarily testing against is
> 2.6.32-220 from CentOS, but we have observed similar behavior from a
> vanilla 3.3 kernel as well. Any help would be greatly appreciated.

I'm assuming you set the hardware sector size to 4k as well?

-- 
Jens Axboe

WARNING: multiple messages have this Message-ID (diff)
From: Jens Axboe <axboe@kernel.dk>
To: Laine Walker-Avina <lwalkera@ieee.org>
Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
	willy@linux.intel.com, lwalkera@micron.com
Subject: Re: Alignment Issue with Direct IO to NVMe Drive
Date: Tue, 27 Nov 2012 13:09:46 +0100	[thread overview]
Message-ID: <50B4AD8A.7020208@kernel.dk> (raw)
In-Reply-To: <CAMi7pMamJK079wQs+5Kaz=zdYGAPS+BFg2xCRKJMqPFMrQvQPQ@mail.gmail.com>

On 2012-11-27 01:35, Laine Walker-Avina wrote:
> Hi all,
> 
> We are experiencing an issue with doing direct IO to a NVMe device I'm
> helping to develop. Every so often, the physical address given by
> sg_dma_address() is aligned to 0x800 instead of 0x1000 as specified by
> blk_queue_dma_alignement(queue, 4095) when the queue is initialized.
> The request is also split over multiple segments to make up for the
> missing space (eg: for a 4k IO it's split into two segments 2k in
> size, and for an 8k IO it's split into 3 segments--2k,4k,2k). Our
> design requires the physical segments given to the device be aligned
> to 4k boundaries and be multiples of 4k in size. When not doing direct
> IO the physical addresses appear to always be 4k aligned as expected.
> One possible issue is the kernel we're primarily testing against is
> 2.6.32-220 from CentOS, but we have observed similar behavior from a
> vanilla 3.3 kernel as well. Any help would be greatly appreciated.

I'm assuming you set the hardware sector size to 4k as well?

-- 
Jens Axboe


  reply	other threads:[~2012-11-27 12:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-27  0:35 Alignment Issue with Direct IO to NVMe Drive Laine Walker-Avina
2012-11-27  0:35 ` Laine Walker-Avina
2012-11-27 12:09 ` Jens Axboe [this message]
2012-11-27 12:09   ` Jens Axboe
2012-11-27 17:05   ` Matthew Wilcox
2012-11-27 17:05     ` Matthew Wilcox
2012-11-27 17:47     ` Laine Walker-Avina
2012-11-27 17:47       ` Laine Walker-Avina
2012-11-27 21:39       ` Matthew Wilcox
2012-11-27 21:39         ` Matthew Wilcox
2012-11-27 22:25         ` Laine Walker-Avina
2012-11-27 22:25           ` Laine Walker-Avina
2012-11-27 17:43   ` Laine Walker-Avina
2012-11-27 17:43     ` Laine Walker-Avina

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=50B4AD8A.7020208@kernel.dk \
    --to=axboe@kernel.dk \
    /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.