From d1fc87659a67a2a6808aa09b238560b376b75e39 Mon Sep 17 00:00:00 2001 From: jimharris Date: Mon, 27 Jul 2015 17:50:05 +0000 Subject: [PATCH] MFS r285915: MFC r285767: 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. Approved by: re (gjb) Sponsored by: Intel git-svn-id: https://svn.freebsd.org/base/releng/10.2@285919 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/dev/nvd/nvd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/nvd/nvd.c b/sys/dev/nvd/nvd.c index b48fb3586..016d72854 100644 --- a/sys/dev/nvd/nvd.c +++ b/sys/dev/nvd/nvd.c @@ -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; -- 2.42.0