Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Feb 2015 14:05:18 +0000
From:      Steven Hartland <killing@multiplay.co.uk>
To:        freebsd-fs@freebsd.org
Subject:   Re: Creating zpool on NVMe Disks takes forever
Message-ID:  <54E5ED9E.9010408@multiplay.co.uk>
In-Reply-To: <54E5D574.8020406@fuckner.net>
References:  <54E5BB12.3060707@fuckner.net> <54E5CF6E.5030906@multiplay.co.uk> <54E5D574.8020406@fuckner.net>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------020602090107060600080905
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit


On 19/02/2015 12:22, Michael Fuckner wrote:
> On 02/19/2015 12:56 PM, Steven Hartland wrote:
>> Disable trim on init:
>> sysctl vfs.zfs.vdev.trim_on_init=0
> this fixed it, thx!
>
> but why does it take >8h to trim 2x 400GB? Or is trimming handled 
> differently on NVMe than on HDD/SSD?

Its very basic but you might want to give the attached patch a go and 
see if it reduces you TRIM time significantly?

     Regards
     Steve

--------------020602090107060600080905
Content-Type: text/x-patch;
 name="nvd-delmaxsize.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="nvd-delmaxsize.patch"

Index: sys/dev/nvd/nvd.c
===================================================================
--- sys/dev/nvd/nvd.c	(revision 278999)
+++ sys/dev/nvd/nvd.c	(working copy)
@@ -287,8 +287,10 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrl
 
 	disk->d_flags = 0;
 
-	if (nvme_ns_get_flags(ns) & NVME_NS_DEALLOCATE_SUPPORTED)
+	if (nvme_ns_get_flags(ns) & NVME_NS_DEALLOCATE_SUPPORTED) {
 		disk->d_flags |= DISKFLAG_CANDELETE;
+		disk->d_delmaxsize = ((off_t)disk->d_sectorsize * ((off_t)1 << 32));
+	}
 
 	if (nvme_ns_get_flags(ns) & NVME_NS_FLUSH_SUPPORTED)
 		disk->d_flags |= DISKFLAG_CANFLUSHCACHE;

--------------020602090107060600080905--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54E5ED9E.9010408>