From owner-freebsd-fs@FreeBSD.ORG Wed Jul 10 18:05:48 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 952D9C13; Wed, 10 Jul 2013 18:05:48 +0000 (UTC) (envelope-from prvs=1903808b5b=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id CF4D01179; Wed, 10 Jul 2013 18:05:47 +0000 (UTC) Received: from r2d2 ([82.69.141.170]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50004909991.msg; Wed, 10 Jul 2013 19:05:44 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Wed, 10 Jul 2013 19:05:44 +0100 (not processed: message from valid local sender) X-MDDKIM-Result: neutral (mail1.multiplay.co.uk) X-MDRemoteIP: 82.69.141.170 X-Return-Path: prvs=1903808b5b=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk Message-ID: From: "Steven Hartland" To: , =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= References: <86zjtupz3r.fsf@nine.des.no> <51DD9801.4090808@delphij.net> Subject: Re: Make ZFS use the physical sector size when computing initial ashift Date: Wed, 10 Jul 2013 19:06:00 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: freebsd-fs@freebsd.org, freebsd-hackers@freebsd.org, ivoras@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jul 2013 18:05:48 -0000 ----- Original Message ----- From: "Xin Li" > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > On 07/10/13 02:02, Dag-Erling Sm?rgrav wrote: >> The attached patch causes ZFS to base the minimum transfer size for >> a new vdev on the GEOM provider's stripesize (physical sector size) >> rather than sectorsize (logical sector size), provided that >> stripesize is a power of two larger than sectorsize and smaller >> than or equal to VDEV_PAD_SIZE. This should eliminate the need for >> ivoras@'s gnop trick when creating ZFS pools on Advanced Format >> drives. > > I think there are multiple versions of this (I also have one[1]) but > the concern is that if one creates a pool with ashift=9, and now > ashift=12, the pool gets unimportable. So there need a way to disable > this behavior. I've tested my patch in all configurations I can think of including exported ashift=9 pools being imported, all no issues. For your example e.g. # Create a 4K pool (min_create_ashift=4K, dev=512) test:src> sysctl vfs.zfs.min_create_ashift vfs.zfs.min_create_ashift: 12 test:src> mdconfig -a -t swap -s 128m -S 512 -u 0 test:src> zpool create mdpool md0 test:src> zdb mdpool | grep ashift ashift: 12 ashift: 12 # Create a 512b pool (min_create_ashift=512, dev=512) test:src> zpool destroy mdpool test:src> sysctl vfs.zfs.min_create_ashift=9 vfs.zfs.min_create_ashift: 12 -> 9 test:src> zpool create mdpool md0 test:src> zdb mdpool | grep ashift ashift: 9 ashift: 9 # Import a 512b pool (min_create_ashift=4K, dev=512) test:src> zpool export mdpool test:src> sysctl vfs.zfs.min_create_ashift=12 vfs.zfs.min_create_ashift: 9 -> 12 test:src> zpool import mdpool test:src> zdb mdpool | grep ashift ashift: 9 ashift: 9 # Create a 4K pool (min_create_ashift=512, dev=4K) test:src> zpool destroy mdpool test:src> mdconfig -d -u 0 test:src> mdconfig -a -t swap -s 128m -S 4096 -u 0 test:src> sysctl vfs.zfs.min_create_ashift=9 vfs.zfs.min_create_ashift: 12 -> 9 test:src> zpool create mdpool md0 test:src> zdb mdpool | grep ashift ashift: 12 ashift: 12 # Import a 4K pool (min_create_ashift=4K, dev=4K) test:src> zpool export mdpool test:src> sysctl vfs.zfs.min_create_ashift=12 vfs.zfs.min_create_ashift: 9 -> 12 test:src> zpool import mdpool test:src> zdb mdpool | grep ashift ashift: 12 ashift: 12 > Another thing (not really related to the automatic detection) is that > we need a way to manually override this setting from command line when > creating the pool, this is under active discussion at Illumos mailing > list right now. > > [1] > https://github.com/trueos/trueos/commit/3d2e3a38faad8df4acf442b055c5e98ab873fb26 Yep has been on my list for a while, based on previous discussions on zfs-devel@. I've not had any time recently but I'm following the illumos thread to see what conclusions they come to. Regards Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk.