Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jul 2013 19:06:00 +0100
From:      "Steven Hartland" <killing@multiplay.co.uk>
To:        <d@delphij.net>, =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
Cc:        freebsd-fs@freebsd.org, freebsd-hackers@freebsd.org, ivoras@freebsd.org
Subject:   Re: Make ZFS use the physical sector size when computing initial ashift
Message-ID:  <E22445B3685C4F3DA19A4778DB541D5E@multiplay.co.uk>
References:  <86zjtupz3r.fsf@nine.des.no> <51DD9801.4090808@delphij.net>

next in thread | previous in thread | raw e-mail | index | archive | help

----- 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.




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