Bug 697144 - mkfs.xfs sunit & swidth don't get applied?
Summary: mkfs.xfs sunit & swidth don't get applied?
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: xfsprogs
Version: 14
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Eric Sandeen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-16 06:46 UTC by lejeczek
Modified: 2011-04-20 14:52 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-04-20 14:52:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description lejeczek 2011-04-16 06:46:44 UTC
Description of problem:

laying out xfs on top of raid5 and trying to use sunint+swidth/su+sw does not bother xfs. With chunk size of 64k and 12 devices in total subsequently giving sunit=128,swidth=1408 I always end up with sunit=16 swidth=176 blks.

having tried lvm and gpt as a middle man makes no difference.

Could it be xfs incorrectly does its inner computations incorrectly?

Version-Release number of selected component (if applicable):
xfsprogs-3.1.2-1.fc14.x86_64

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Eric Sandeen 2011-04-16 16:33:35 UTC
It's not clear to me what bug you see; can you provide your mkfs.xfs commandline, its output, and the resulting xfs_info /mount/point output once it's mounted?

Thanks,
-Eric

Comment 2 lejeczek 2011-04-19 15:58:35 UTC
mkfs.xfs sunit=128,swidth=1408


mkfs_info:

meta-data=/dev/mapper/xyratex_ld0-LD0 isize=256    agcount=32, agsize=166194432 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=5318217728, imaxpct=5
         =                       sunit=32     swidth=352 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal               bsize=4096   blocks=521728, version=2
         =                       sectsz=512   sunit=8 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0


any other values used for sunit & swidth and the results are always, I can see, smaller as if division by eight took place.

Comment 3 lejeczek 2011-04-19 16:05:02 UTC
mkfs.xfs -d sunit=1024,swidth=11264 /dev/mapper/xyratex_ld1-LD1 -f
log stripe unit (524288 bytes) is too large (maximum is 256KiB)
log stripe unit adjusted to 32KiB
meta-data=/dev/mapper/xyratex_ld1-LD1 isize=256    agcount=20, agsize=268435328 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=5318217728, imaxpct=5
         =                       sunit=128    swidth=1408 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal log           bsize=4096   blocks=521728, version=2
         =                       sectsz=512   sunit=8 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

Comment 4 lejeczek 2011-04-19 17:35:46 UTC
but let say I factor this in and while create I use values respectively larger, then if I leave something like below in fstab:
sunit=256,swidth=2816

next time xfs_info again shows:
sunit=32     swidth=352 blks

Comment 5 Eric Sandeen 2011-04-19 17:55:06 UTC
The units used here are horrible and confusing.  at mkfs.xfs time, sunit/swidth are specified in multiples of 512 units.  So if you want 16k, you say 32.  IOW, you specify number of sectors.

But it's reported back to you in fs block units.  Hence the factor of 8 (4096/512).

It's all consistent, if you know that one ugly fact.

Here I say sunit=128, which means 128 sectors, or 16 4k blocks:

#  mkfs.xfs -dfile,name=fsfile,size=258m,sunit=128,swidth=1408
meta-data=fsfile                 isize=256    agcount=4, agsize=16512 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=66048, imaxpct=25
         =                       sunit=16     swidth=176 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal log           bsize=4096   blocks=1200, version=2
         =                       sectsz=512   sunit=16 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

# mount -o loop fsfile  mnt/

# xfs_info mnt/
meta-data=/dev/loop0             isize=256    agcount=4, agsize=16512 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=66048, imaxpct=25
         =                       sunit=16     swidth=176 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal               bsize=4096   blocks=1200, version=2
         =                       sectsz=512   sunit=16 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

in both cases I get back "16" for sunit... with that "blks" unit at the end of the line.

# rpm -q xfsprogs
xfsprogs-3.1.2-1.fc14.x86_64

The output is icky, but it is doing what was asked.

sunit/swidth take sectors; mkfs & xfs_info output blocks.

Using su/sw is sometimes more intuitive, as su simply takes bytes, and sw is a multiplier of su.

-Eric

Comment 6 lejeczek 2011-04-19 19:02:03 UTC
ugh! it is totally misleading, either in the tool's output or in manuals it would certainly be GREAT if this was stressed out. yes, I've overlooked it, but if one ain't, somehow knowing beforehand, looking for it then easily overlooks it.

so, do we relay on mkfs.xfs and mount to auto detect fs params, or we should give it all at mount time or into fstab in order to have most optimal fs?

many! thanks Eric for explaining it all

Comment 7 Eric Sandeen 2011-04-19 19:08:33 UTC
Well, the mkfs.xfs manual is quite explicit in what units it takes.  Though I do have to look it up every time :)

The output does have the "blks" unit appended but that's not so obvious.

No need for mount-time options, if you've set it at mkfs time it's persistent.  Mounting with new options will change what's stored in the superblock, if geometry changes.

As for whether you should specify it at all or let mkfs sort it out, that depends somewhat on your storage.  For software raid, mkfs.xfs should just do the right thing.  For hardware, it depends on whether the hardware exports geometry.

-Eric

Comment 8 lejeczek 2011-04-20 07:14:34 UTC
Celsiuses are Celsiuses, Fahrenheits are Fahrenheits, I believe you know what I mean.
Thanks again, I presume we close it as not-a-bug?

Comment 9 Eric Sandeen 2011-04-20 14:52:20 UTC
(In reply to comment #8)

> Thanks again, I presume we close it as not-a-bug?

Yes, I'll do that, thanks.


Note You need to log in before you can comment on or make changes to this bug.