Skip to contentSkip to conversation

mkfs.xfs: cannot (re)set log sunit=0

DISCUSSION Mario 'BitKoenig' Holbe 2 participants 2 messages Jul 26, 2010 – Jul 27, 2010

lore
Share & tools
lore
#0 lore raw

Hello,

I intend to set up a XFS filesystem on a RAID0 (Linux md) with 512k Chunk Size. Since I cannot align the log section sunit to 512k, and since the filesystem will have not much write activity anyways (in fact, it'll be mounted read-only most of the time), I tried not to align the log section sunit at all via -l sunit=0, but this does not appear to work:

# truncate -s 1G /tmp/foo{0,1}
# losetup /dev/loop0 /tmp/foo0; losetup /dev/loop1 /tmp/foo1
# mdadm -C -l raid0 -n 2 /dev/md9 /dev/loop[01]
# mkfs.xfs -l sunit=0 /dev/md9
log stripe unit (524288 bytes) is too large (maximum is 256KiB)
log stripe unit adjusted to 32KiB
meta-data=/dev/md9               isize=256    agcount=8, agsize=65408 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=523264, imaxpct=25
         =                       sunit=128    swidth=256 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=8 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

Is this a bug or a feature?

The minimum I was able to limit the log sunit to was -l sunit=8, i.e. 1 block. Is there a difference between sunit=0 and sunit=1 in practice or are single log entries aligned to blocks anyways?

Btw...
Since the filesystem is mostly read-only, I was also thinking about reducing the size of the log section. The planned filesystem will be 5.5T or bigger, which results in 2G log section per default. I thought about limiting it to 128M or 64M. There will be no concurrent write activity on the fs. Together with the zero-alignment, what do you think about that?

PS: I'm not on this list, please CC: me in replies. My Mail-Followup-To:
header should take care of that.

Thanks for your help & regards
Mario

Signature · 2 lines
File names are infinite in length where infinity is set to 255 characters.
                                -- Peter Collinson, "The Unix File System"

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw
Quoted 8 lines · Mario 'BitKoenig' Holbe

Hello,

I intend to set up a XFS filesystem on a RAID0 (Linux md) with 512k Chunk Size. Since I cannot align the log section sunit to 512k, and since the filesystem will have not much write activity anyways (in fact, it'll be mounted read-only most of the time), I tried not to align the log section sunit at all via -l sunit=0, but this does not appear to work:

Of course - when you specific a value yourself, it has to be a valid value and for version 2 logs that minimum value for th lsunit is one log block. Given that:

....

Quoted 1 line

log =internal log bsize=4096 blocks=2560, version=2

....

                                   ^^^^^^^^^^

Your log block size is 4k, then:

Quoted 4 lines

Is this a bug or a feature?

The minimum I was able to limit the log sunit to was -l sunit=8, i.e. 1 block.

This is the correct minimum you are allowed to specify.

Quoted 2 lines

Is there a difference between sunit=0 and sunit=1 in practice or are single log entries aligned to blocks anyways?

sunit=0 is an invalid configuration for a version 2 log. Filesystems without a data sunit default to a lsunit = 1 log block, so in practice version 2 logs are always aligned/padded in some way.

Quoted 7 lines

Btw...
Since the filesystem is mostly read-only, I was also thinking about reducing the size of the log section. The planned filesystem will be 5.5T or bigger, which results in 2G log section per default. I thought about limiting it to 128M or 64M. There will be no concurrent write activity on the fs. Together with the zero-alignment, what do you think about that?

That'll be fine - the maximum log size until a couple of years ago was 128MB, and I still do most of my benchmarking with a log that size....

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs