[RFC 0/4] partial sector read support

Keith Busch kbusch at kernel.org
Tue May 10 17:15:43 PDT 2022


On Tue, May 10, 2022 at 03:41:35PM -0700, Sagi Grimberg wrote:
> > From: Keith Busch <kbusch at kernel.org>
> > 
> > Don't you just hate that you must read a full sector when you only cared
> > about a few bytes? Well, good news! Standardized protocols provide a way
> > for the host to describe unwanted read data, allowing partial sector
> > access. This lets applications reduce allocated memory that was used to
> > hold the unwanted data, while also reducing link traffic.
> > 
> > This series enables this for the NVMe protocol through direct io. With
> > this, a userspace app can read a single contiguous byte range, subject
> > to hardware DMA constraints. An in-kernel user could theorectically
> > construct a bio to read multiple discontiguous ranges if desired.
> 
> So userspace needs to look for both bb queue flag and dma alignment to
> infer supported range(s)?

If you don't know ahead of time, then yes, userspace will need to query the
attributes. There are existing attributes that inform userspace of unique
hardware capabilities that affect their access: 'dax' and 'zoned' are such
examples that come to mind.



More information about the Linux-nvme mailing list