Message ID | 20151030213511.GK7716@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
On Fri, Oct 30, 2015 at 02:35:11PM -0700, Nishanth Aravamudan wrote: > Given that it's 4K just about everywhere by default (and sort of > implicitly expected to be, I guess), I think I'd prefer we default to > 4K. That should mitigate the performance impact (I'll ask our IO team to > do some runs, but since this impacts functionality on some hardware, I > don't think it's too relevant for now). Unless there are NVMe devcies > with a MPSMAX < 4K? Right, I assumed MPSMIN was always 4k for the same reason you mentioned, but you can hard code it like you've done in your patch. The spec defines MPSMAX such that it's impossible to find a device with MPSMAX < 4k.
On 30.10.2015 [21:48:48 +0000], Keith Busch wrote: > On Fri, Oct 30, 2015 at 02:35:11PM -0700, Nishanth Aravamudan wrote: > > Given that it's 4K just about everywhere by default (and sort of > > implicitly expected to be, I guess), I think I'd prefer we default to > > 4K. That should mitigate the performance impact (I'll ask our IO team to > > do some runs, but since this impacts functionality on some hardware, I > > don't think it's too relevant for now). Unless there are NVMe devcies > > with a MPSMAX < 4K? > > Right, I assumed MPSMIN was always 4k for the same reason you mentioned, > but you can hard code it like you've done in your patch. > > The spec defines MPSMAX such that it's impossible to find a device > with MPSMAX < 4k. Great, thanks! -Nish
On Fri, Oct 30, 2015 at 02:35:11PM -0700, Nishanth Aravamudan wrote: > diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c > index ccc0c1f93daa..a9a5285bdb39 100644 > --- a/drivers/block/nvme-core.c > +++ b/drivers/block/nvme-core.c > @@ -1717,7 +1717,12 @@ static int nvme_configure_admin_queue(struct nvme_dev *dev) > u32 aqa; > u64 cap = readq(&dev->bar->cap); > struct nvme_queue *nvmeq; > - unsigned page_shift = PAGE_SHIFT; > + /* > + * default to a 4K page size, with the intention to update this > + * path in the future to accomodate architectures with differing > + * kernel and IO page sizes. > + */ > + unsigned page_shift = 12; > unsigned dev_page_min = NVME_CAP_MPSMIN(cap) + 12; > unsigned dev_page_max = NVME_CAP_MPSMAX(cap) + 12; Looks good as a start. Note that all the MPSMIN/MAX checking could be removed as NVMe devices must support 4k pages.
On Tue, Nov 03, 2015 at 05:18:24AM -0800, Christoph Hellwig wrote: > On Fri, Oct 30, 2015 at 02:35:11PM -0700, Nishanth Aravamudan wrote: > > diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c > > index ccc0c1f93daa..a9a5285bdb39 100644 > > --- a/drivers/block/nvme-core.c > > +++ b/drivers/block/nvme-core.c > > @@ -1717,7 +1717,12 @@ static int nvme_configure_admin_queue(struct nvme_dev *dev) > > u32 aqa; > > u64 cap = readq(&dev->bar->cap); > > struct nvme_queue *nvmeq; > > - unsigned page_shift = PAGE_SHIFT; > > + /* > > + * default to a 4K page size, with the intention to update this > > + * path in the future to accomodate architectures with differing > > + * kernel and IO page sizes. > > + */ > > + unsigned page_shift = 12; > > unsigned dev_page_min = NVME_CAP_MPSMIN(cap) + 12; > > unsigned dev_page_max = NVME_CAP_MPSMAX(cap) + 12; > > Looks good as a start. Note that all the MPSMIN/MAX checking could > be removed as NVMe devices must support 4k pages. MAX can go, and while it's probably the case that all devices support 4k, it's not a spec requirement, so we should keep the dev_page_min check.
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index ccc0c1f93daa..a9a5285bdb39 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c @@ -1717,7 +1717,12 @@ static int nvme_configure_admin_queue(struct nvme_dev *dev) u32 aqa; u64 cap = readq(&dev->bar->cap); struct nvme_queue *nvmeq; - unsigned page_shift = PAGE_SHIFT; + /* + * default to a 4K page size, with the intention to update this + * path in the future to accomodate architectures with differing + * kernel and IO page sizes. + */ + unsigned page_shift = 12; unsigned dev_page_min = NVME_CAP_MPSMIN(cap) + 12; unsigned dev_page_max = NVME_CAP_MPSMAX(cap) + 12;