]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
mkfs.xfs: Don't stagger AG for a single disk
authorDonald Douwsma <ddouwsma@redhat.com>
Fri, 15 Sep 2017 13:33:42 +0000 (08:33 -0500)
committerEric Sandeen <sandeen@redhat.com>
Fri, 15 Sep 2017 13:33:42 +0000 (08:33 -0500)
commit9a106b5fbb88342f0ee02891d1bbb0e3c5a93d03
tree5a6c6897771a8f25dacb2c68112a9b7cd5cbe0cf
parent459cadd5b4eaf49b0124d953b0a8f744be65feee
mkfs.xfs: Don't stagger AG for a single disk

When sunit and swidth are used mkfs.xfs tries to avoid all allocation
groups aligning on the same stripe and will attempt to stagger them
across the stripes that make up swidth.  If there is only one stripe
then there is no benefit in this optimisation.

$ truncate -s10G xfs_10G_su256k_sw1.image
$ mkfs.xfs -d su=256k,sw=1 xfs_10G_su256k_sw1.image
meta-data=xfs_10G_su256k_sw1.image isize=512    agcount=16, agsize=163776 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=2620416, imaxpct=25
         =                       sunit=64     swidth=64 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=64 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

A side effect of the optimisation is that the size adjustment used to stager
the allocation groups causes the last sunit of storage to be unused.

$ echo $((2620416*4096))
10733223936
$ ls -l xfs_10G_su256k_sw1.image
-rw-rw-r--. 1 test test 10737418240 Aug 30 10:54 xfs_10G_su256k_sw1.image

Skip this optimisation when sunit == swidth.

Signed-off-by: Donald Douwsma <ddouwsma@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
mkfs/xfs_mkfs.c