nvd: set d_delmaxsize to full capacity of NVMe namespace

The NVMe specification has no ability to specify a maximum delete size
that is less than the full capacity of the namespace - so just using the
namespace size is the correct value here.

This fixes reported issues where ZFS trim on init looked like it was
hanging the system - previously the default I/O max size (128KB on
Intel NVMe controllers) was used for delete operations which worked out
to only about 8MB/s.  With this patch I can add an 800GB DC P3700
drive to a ZFS pool in about 15-20 seconds.

Reported by: Dylan Just <dylan@techtangents.com>
MFC after:	3 days
Sponsored by:	Intel
This commit is contained in:
Jim Harris 2015-07-21 20:53:21 +00:00
parent 75ac3a7359
commit 70fb74bd12
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=285767

View file

@ -278,6 +278,7 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_arg)
disk->d_maxsize = nvme_ns_get_max_io_xfer_size(ns);
disk->d_sectorsize = nvme_ns_get_sector_size(ns);
disk->d_mediasize = (off_t)nvme_ns_get_size(ns);
disk->d_delmaxsize = (off_t)nvme_ns_get_size(ns);
if (TAILQ_EMPTY(&disk_head))
disk->d_unit = 0;