Default mount options (that suck less).
Hello,
XFS's default mount options are in most cases sub-optimal, we should try to have more sensible defaults, so far I'm following some quick dave-powered recomendations:
- version 2 logs
- attr2
- lazy superblock counters
- less allocation groups for single disk configs
- imaxpct default can be reduced
it is currently 25, what would be reasonable ?
- dropping the ability to turn unwritten extents off completely
please submit your pet-idea for better defaults here.
Cheers,
Signature · 1 line
Niv
Quoted 3 lines · Niv Sardi
Hello,
XFS's default mount options are in most cases sub-optimal, we should try
Mkfs options ;)
Quoted 11 lines
to have more sensible defaults, so far I'm following some quick dave-powered recomendations:
- version 2 logs
- attr2
- lazy superblock counters
- less allocation groups for single disk configs- imaxpct default can be reduced
it is currently 25, what would be reasonable ?
Given that 25% on a 4GB filesystem will allow about 5million inodes, I think it's probably reasonable to bring it down to 5% by the time we pass 1TB and 1% by 50TB.....
Cheers,
Dave.
Signature · 3 lines
Dave Chinner Principal Engineer SGI Australian Software Group
Quoted 16 lines · Niv Sardi
Quoted 3 lines
Hello,
XFS's default mount options are in most cases sub-optimal, we should try
Mkfs options ;)
Quoted 8 lines
to have more sensible defaults, so far I'm following some quick dave-powered
recomendations:- version 2 logs
- attr2
- lazy superblock counters
- less allocation groups for single disk configs
Version 2 inodes should always be created by default (there are both userspace and kernel changes required for that).
cheers.
--
Nathan
Quoted 15 lines · David Chinner
Quoted 3 lines · Niv Sardi
Hello,
XFS's default mount options are in most cases sub-optimal, we should try
Mkfs options ;)
Quoted 8 lines
to have more sensible defaults, so far I'm following some quick dave-powered recomendations:
- version 2 logs
- attr2
- lazy superblock counters
- less allocation groups for single disk configs
Quoted 7 lines
Quoted 3 lines
- imaxpct default can be reduced
it is currently 25, what would be reasonable ?
Given that 25% on a 4GB filesystem will allow about 5million inodes, I think it's probably reasonable to bring it down to 5% by the time we pass 1TB and 1% by 50TB.....
But what does this affect? It's a cap, but it doesn't affect allocation policy or anything does it? What's the downside to 25%?
-Eric
Quoted 18 lines · Eric Sandeen
Quoted 17 lines · David Chinner
Quoted 3 lines · Niv Sardi
Hello,
XFS's default mount options are in most cases sub-optimal, we should try
Mkfs options ;)
Quoted 10 lines
to have more sensible defaults, so far I'm following some quick dave-powered recomendations:
- version 2 logs
- attr2
- lazy superblock counters
- less allocation groups for single disk configs- imaxpct default can be reduced
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
it is currently 25, what would be reasonable ?
Given that 25% on a 4GB filesystem will allow about 5million inodes, I think it's probably reasonable to bring it down to 5% by the time we pass 1TB and 1% by 50TB.....
But what does this affect? It's a cap, but it doesn't affect allocation policy or anything does it? What's the downside to 25%?
It reserves allocation groups as "metadata only" for inode32 filesystems so data doesn't get placed in them untill all other space is full. So at 1TB, we don't use 25% of the filesystem until the other 75% is full, yet to hold 4 million inodes we only need about 1GB of space. so 5GB out of 1TB gives us space in the filesystem for ~20m million inodes by default. AFAICT, this is the only place it is used.
Likewise, at 50TB, we're only going to be able to use 2% of the filesystem for inodes with inode32. At 100TB, it's meaningless.....
Cheers,
Dave.
Signature · 3 lines
Dave Chinner Principal Engineer SGI Australian Software Group
Quoted 8 lines · Niv Sardi
Hello,
XFS's default mount options are in most cases sub-optimal, we should try to have more sensible defaults, so far I'm following some quick dave-powered recomendations:
- version 2 logs
- attr2
FWIW any anaconda-installed xfs filesystems have been using attr2 since FC6, and after the initial pain, I haven't heard any reports of problems.
Quoted 10 lines
- lazy superblock counters
- less allocation groups for single disk configs- imaxpct default can be reduced
it is currently 25, what would be reasonable ?
- dropping the ability to turn unwritten extents off completely
please submit your pet-idea for better defaults here.
larger logbuf count/size seems to be the other tuning that's thrown around a lot.
-Eric
Quoted 4 lines · Eric Sandeen
Quoted 3 lines · Niv Sardi
XFS's default mount options are in most cases sub-optimal, we should try to have more sensible defaults, so far I'm following some quick dave-powered recomendations:
Is there any reason to not set the default inode size to 512 bytes? ..as suggested in:
http://www.suse.de/~agruen/acl/linux-acls/online/
Signature · 2 lines
Regards, Hannes Dorbath
Quoted 10 lines · Hannes Dorbath
Quoted 4 lines · Eric Sandeen
Quoted 3 lines · Niv Sardi
XFS's default mount options are in most cases sub-optimal, we should try to have more sensible defaults, so far I'm following some quick dave-powered recomendations:
Is there any reason to not set the default inode size to 512 bytes? ..as suggested in:
attr2 should help with the problem now... unless there is some common case where attr2+256 still spills out a lot?
-Eric
Quoted 7 lines · Eric Sandeen
Quoted 6 lines · Hannes Dorbath
Quoted 4 lines · Eric Sandeen
Quoted 3 lines · Niv Sardi
XFS's default mount options are in most cases sub-optimal, we should try to have more sensible defaults, so far I'm following some quick dave-powered recomendations:
Quoted 7 lines
Quoted 4 lines
Is there any reason to not set the default inode size to 512 bytes? ..as suggested in:
attr2 should help with the problem now... unless there is some common case where attr2+256 still spills out a lot?
Probably SELinux+Beagle attributes?
Attribute "Beagle.Fingerprint" has a 25 byte value Attribute "Beagle.Uid" has a 22 byte value Attribute "Beagle.MTime" has a 14 byte value Attribute "Beagle.Filter" has a 36 byte value Attribute "Beagle.AttrTime" has a 14 byte value
That's 111bytes just for values...
Signature · 2 lines
Stewart Smith ([email protected]) http://www.flamingspork.com/
Quoted 10 lines · Stewart Smith
Probably SELinux+Beagle attributes?
Attribute "Beagle.Fingerprint" has a 25 byte value Attribute "Beagle.Uid" has a 22 byte value Attribute "Beagle.MTime" has a 14 byte value Attribute "Beagle.Filter" has a 36 byte value Attribute "Beagle.AttrTime" has a 14 byte value
That's 111bytes just for values...
and another ~70 bytes for the names.
Signature · 1 line
Nathan
Quoted 9 lines · Nathan Scott
Quoted 8 lines · Stewart Smith
Probably SELinux+Beagle attributes?
Attribute "Beagle.Fingerprint" has a 25 byte value Attribute "Beagle.Uid" has a 22 byte value Attribute "Beagle.MTime" has a 14 byte value Attribute "Beagle.Filter" has a 36 byte value Attribute "Beagle.AttrTime" has a 14 byte value
Quoted 3 lines
Quoted 1 line
That's 111bytes just for values...
and another ~70 bytes for the names.
bleah!
Ok, so we can have a "beagle" filesystem type in mkfs.xfs.conf ;-)
-Eric
Quoted 5 lines · Eric Sandeen
Quoted 1 line · Niv Sardi
please submit your pet-idea for better defaults here.
larger logbuf count/size seems to be the other tuning that's thrown around a lot.
Well, we already default to 8 logbufs, and 256k log buffers are not a win in a lot of situations. The log buffer size is a mount option, so it's much easier to tweak once we default to v2 logs...
Cheers,
Dave.
Signature · 3 lines
Dave Chinner Principal Engineer SGI Australian Software Group
Quoted 11 lines · Niv Sardi
Hello,
XFS's default mount options are in most cases sub-optimal, we should try to have more sensible defaults, so far I'm following some quick dave-powered recomendations:
- version 2 logs
- attr2
- lazy superblock counters
- less allocation groups for single disk configs
Quoted 7 lines
- imaxpct default can be reduced
it is currently 25, what would be reasonable ?
- dropping the ability to turn unwritten extents off completely
please submit your pet-idea for better defaults here.
Sorry for all the replies ;-)
What would you think of a mkfs conf file like e2fsprogs has, which defines filesystem classes, and defaults for each? (small, news, largefile, etc...)
-Eric
Quoted 3 lines · Eric Sandeen
What would you think of a mkfs conf file like e2fsprogs has, which defines filesystem classes, and defaults for each? (small, news, largefile, etc...)
That makes more sense for ext2/3 where some meta-data isn't dynamically allocated as needed, for example, historically nntp servers used one file per article and would often run out of inodes.
Quoted 9 lines · Chris Wedgwood
Quoted 3 lines · Eric Sandeen
What would you think of a mkfs conf file like e2fsprogs has, which defines filesystem classes, and defaults for each? (small, news, largefile, etc...)
That makes more sense for ext2/3 where some meta-data isn't dynamically allocated as needed, for example, historically nntp servers used one file per article and would often run out of inodes.
well, anything that is fixed at mkfs time could use this... inode size, ag count, etc. If there are common use cases which would want different mkfs-fixed defaults, it might make sense.
-Eric
Quoted 20 lines · Eric Sandeen
Quoted 11 lines · Niv Sardi
Hello,
XFS's default mount options are in most cases sub-optimal, we should try to have more sensible defaults, so far I'm following some quick dave-powered recomendations:
- version 2 logs
- attr2
- lazy superblock counters
- less allocation groups for single disk configsQuoted 7 lines
- imaxpct default can be reduced
it is currently 25, what would be reasonable ?
- dropping the ability to turn unwritten extents off completely
please submit your pet-idea for better defaults here.
Quoted 8 lines
Sorry for all the replies ;-)
What would you think of a mkfs conf file like e2fsprogs has, which defines filesystem classes, and defaults for each? (small, news, largefile, etc...)
-Eric
It might be interesting if people let us know what non-default mkfs and mount options that they are using for their various configurations/classes.
Didn't Russell C. have some survey years ago - can't remember if that was for h/ware or what now.
Maybe Dave C. or others have some suggestions from performance runs for various types of workloads. Do we have this compiled somewhere?
--Tim
Quoted 5 lines · Timothy Shimmin
It might be interesting if people let us know what non-default mkfs and mount options that they are using for their various configurations/classes.
Didn't Russell C. have some survey years ago - can't remember if that was for h/ware or what now.
We have a ~100TB filesystem that was made with the default mkfs.xfs options from memory. The only mount option we use is inode64.
Quoted 9 lines · James Braid
Quoted 5 lines · Timothy Shimmin
It might be interesting if people let us know what non-default mkfs and mount options that they are using for their various configurations/classes.
Didn't Russell C. have some survey years ago - can't remember if that was for h/ware or what now.We have a ~100TB filesystem that was made with the default mkfs.xfs options from memory. The only mount option we use is inode64.
Impressive, what architecture do you run? ia64 or x86_64? What performance differences did you see?
Justin.
Quoted 1 line · Justin Piszcz
Impressive, what architecture do you run? ia64 or
x86_64? What performance differences did you see?
It's all just commodity hardware - HP DL385 x86_64 server with a pile of cheap Infortrend RAID arrays. Performance wise we're limited by a single HBA to the disks, which is fine for this particular application because we saturate the network first.
xfs_repair takes a good 36 hours or so and 16-ish GB of memory to run. (we had to run it recently, thanks to a flakey RAID)
Quoted 9 lines · James Braid
Quoted 5 lines · Timothy Shimmin
It might be interesting if people let us know what non-default mkfs and mount options that they are using for their various configurations/classes.
Didn't Russell C. have some survey years ago - can't remember if that was for h/ware or what now.We have a ~100TB filesystem that was made with the default mkfs.xfs options from memory. The only mount option we use is inode64.
Hm, which has been another pet peeve of mine; shouldn't inode64 flag the SB when the first >32bit inode is created? It always bothered me that inode64 was a mount option which appears to be something you could turn back off, even though there may be >32bit inodes on disk already.
-Eric
Quoted 2 lines · James Braid
We have a ~100TB filesystem that was made with the default mkfs.xfs options from memory. The only mount option we use is inode64.
Weta? Mostly very large files?
Quoted 6 lines · Chris Wedgwood
Quoted 2 lines · James Braid
We have a ~100TB filesystem that was made with the default mkfs.xfs options from memory. The only mount option we use is inode64.
Weta? Mostly very large files?
Not weta, but another big vfx company
This particular filesystem is used for nearline backups from a bunch of NFS servers (which run XFS as well - we love XFS). The average file size is only about a megabyte.
Quoted 11 lines · Niv Sardi
Hello,
XFS's default mount options are in most cases sub-optimal, we should try to have more sensible defaults, so far I'm following some quick dave-powered recomendations:
- version 2 logs
- attr2
- lazy superblock counters
- less allocation groups for single disk configs
Quoted 7 lines
- imaxpct default can be reduced
it is currently 25, what would be reasonable ?
- dropping the ability to turn unwritten extents off completely
please submit your pet-idea for better defaults here.
Another one for you - make the log larger. The kernel code supports a log of up to 2GB, so mkfs could making a larger log without requiring changes elsewhere.
Cheers,
Dave.
Signature · 3 lines
Dave Chinner Principal Engineer SGI Australian Software Group
Thanks for all your insightfull replys
Here's the state of my xfsprogs/TODO:
DONE - version 2 logs
DONE - attr2
BUG - lazy superblock counters
It looks like it's a fixed bug that should be commited soon:
Quoted 2 lines
[itchy] dmesg -c
[itchy] dd if=/dev/zero of=blah bs=1 seek=100G count=1
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.00151443 s, 0.7 kB/s
# this is my patched mkfs
Quoted 1 line
[itchy] mkfs.xfs -f -l lazy-count=1 blah
meta-data=/home/xaiki/blah isize=256 agcount=8, agsize=3276800 blks
= sectsz=512 attr=2
data = bsize=4096 blocks=26214400, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096
log =internal log bsize=4096 blocks=12800, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0Quoted 1 line
[itchy] mount -o loop blah /mnt
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so
Quoted 1 line
[itchy] dmesg -c
XFS: bad version
XFS: SB validate failed
DONE - version 2 inodes
DONE - dropping the ability to turn unwritten extents off completely
DONE/ASK - imaxpct default can be reduced
Quoted 3 lines
Given that 25% on a 4GB filesystem will allow about 5million inodes, I think it's probably reasonable to bring it down to 5% by the time we pass 1TB and 1% by 50TB.....
I implemented this as a simple step function, do we need something smarter ?
ASK - larger log
Quoted 3 lines
Another one for you - make the log larger. The kernel code supports a log of up to 2GB, so mkfs could making a larger log without requiring changes elsewhere.
dchiner told me that we have issues with big logs, anyway, how much shall I increase the default ?
ASK - less allocation groups for single disk configs
Again, being quite new, I'd need magnitude orders of what's reasonable, I now multiply by 2 the AG size, witch gives me 2x less AGs.
Eric: mkfs.conf sounds like a great idea to me, but i don't think it should be exclusive to XFS.
Please find attached the early patches, comments are welcome.
Cheers,
Signature · 1 line
Niv
Quoted 1 line
From
af7d810cc78c541e91b712cebbfc6a0f342ac38fMon Sep 17 00:00:00 2001
From: Niv Sardi <xaiki@itchy.(none)>
Date: Mon, 29 Oct 2007 14:56:45 +1100
Subject: [PATCH] Default to log version 2
--- xfsprogs/mkfs/xfs_mkfs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
xfsprogs/mkfs/xfs_mkfs.c +1 -1
@@ -686,7 +686,7 @@ main( ilflag = imflag = ipflag = isflag =0 ; liflag = laflag = lsflag = ldflag = lvflag =0 ; loginternal =1 ; - logversion =1 ; + logversion =2 ; logagno = logblocks = rtblocks = rtextblocks =0 ; Nflag = nlflag = nsflag = nvflag =0 ; dirblocklog = dirblocksize = dirversion =0 ;
Signature · 1 line
1.5.3.4
Quoted 1 line
From
92b5a69925f10b42daadad29d2269b71d4f0f23dMon Sep 17 00:00:00 2001
From: Niv Sardi <xaiki@itchy.(none)>
Date: Mon, 29 Oct 2007 14:57:21 +1100
Subject: [PATCH] Default to version 2 attributes.
--- xfsprogs/mkfs/xfs_mkfs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
xfsprogs/mkfs/xfs_mkfs.c +1 -1
@@ -677,7 +677,7 @@ main(bindtextdomain (PACKAGE ,LOCALEDIR );textdomain (PACKAGE ); - attrversion =0 ; + attrversion =2 ; blflag = bsflag = slflag = ssflag = lslflag = lssflag =0 ; blocklog = blocksize =0 ; sectorlog = lsectorlog =XFS_MIN_SECTORSIZE_LOG ;
Signature · 1 line
1.5.3.4
Quoted 1 line
From
42508704dfd2674847347c3266aebff20fae77baMon Sep 17 00:00:00 2001
From: Niv Sardi <[email protected]>
Date: Mon, 29 Oct 2007 15:23:22 +1100
Subject: [PATCH] Drop the ability to turn unwritten extents off completly
--- xfsprogs/mkfs/xfs_mkfs.c | 38 +++++++++++++------------------------- xfsprogs/mkfs/xfs_mkfs.h | 6 +++--- 2 files changed, 16 insertions(+), 28 deletions(-)
xfsprogs/mkfs/xfs_mkfs.c +13 -25
@@ -56,25 +56,23 @@ char *dopts[] = { "sunit",#define D_SWIDTH 5 "swidth", -#define D_UNWRITTEN 6 - "unwritten", -#define D_AGSIZE 7 +#define D_AGSIZE 6 "agsize", -#define D_SU 8 +#define D_SU 7 "su", -#define D_SW 9 +#define D_SW 8 "sw", -#define D_SECTLOG 10 +#define D_SECTLOG 9 "sectlog", -#define D_SECTSIZE 11 +#define D_SECTSIZE 10 "sectsize", -#define D_NOALIGN 12 +#define D_NOALIGN 11 "noalign", -#define D_RTINHERIT 13 +#define D_RTINHERIT 12 "rtinherit", -#define D_PROJINHERIT 14 +#define D_PROJINHERIT 13 "projinherit", -#define D_EXTSZINHERIT 15 +#define D_EXTSZINHERIT 14"extszinherit" , NULL };
@@ -604,7 +602,6 @@ main(int dsw;int dsunit;int dswidth; -int extent_flagging;int force_overwrite;struct fsxattr fsx;int iaflag;
@@ -697,7 +694,6 @@ main( dsize = logsize = rtsize = rtextsize = protofile =NULL ; dsu = dsw = dsunit = dswidth = lalign = lsu = lsunit =0 ; nodsflag = norsflag =0 ; - extent_flagging =1 ; force_overwrite =0 ; worst_freelist =0 ; lazy_sb_counters =0 ;
@@ -877,14 +873,6 @@ main( D_NOALIGN); nodsflag =1 ;break ; -case D_UNWRITTEN : -if (!value) -reqval ('d' , dopts,D_UNWRITTEN ); - c =atoi (value); -if (c <0 || c >1 ) -illegal (value,"d unwritten" ); - extent_flagging = c; -break ;case D_SECTLOG :if (!value)reqval ('d' , dopts,D_SECTLOG );
@@ -1990,7 +1978,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"),"meta-data=%-22s isize=%-6d agcount=%lld, agsize=%lld blks\n" " =%-22s sectsz=%-5u attr=%u\n" "data =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n" -" =%-22s sunit=%-6u swidth=%u blks, unwritten=%u\n" +" =%-22s sunit=%-6u swidth=%u blks\n" "naming =version %-14u bsize=%-6u\n" "log =%-22s bsize=%-6d blocks=%lld, version=%d\n" " =%-22s sectsz=%-5u sunit=%d blks, lazy-count=%d\n"
@@ -1999,7 +1987,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"),"" , sectorsize, attrversion,"" , blocksize, (long long )dblocks, imflag ? imaxpct :XFS_DFL_IMAXIMUM_PCT , -"" , dsunit, dswidth, extent_flagging, +"" , dsunit, dswidth, dirversion, dirversion ==1 ? blocksize : dirblocksize, logfile,1 << blocklog, (long long )logblocks, logversion, "", lsectorsize, lsunit, lazy_sb_counters,
@@ -2066,7 +2054,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), } sbp->sb_features2 =XFS_SB_VERSION2_MKFS (lazy_sb_counters, attrversion ==2 ,0 ); sbp->sb_versionnum =XFS_SB_VERSION_MKFS ( - iaflag, dsunit !=0 , extent_flagging, + iaflag, dsunit !=0 , dirversion ==2 , logversion ==2 , attrversion ==1 , (sectorsize !=BBSIZE || lsectorsize !=BBSIZE ), sbp->sb_features2 !=0 );
@@ -2537,7 +2525,7 @@ usage( void ) /* blocksize */ [-b log=n|size=num]\n\ /* data subvol */ [-d agcount=n,agsize=n,file,name=xxx,size=num,\n\ (sunit=value,swidth=value|su=num,sw=num),\n\ - sectlog=n|sectsize=num,unwritten=0|1]\n\ + sectlog=n|sectsize=num\n\ /* inode size */ [-i log=n|perblock=n|size=num,maxpct=n,attr=0|1|2]\n\ /* log subvol */ [-l agnum=n,internal,size=num,logdev=xxx,version=n\n\ sunit=value|su=num,sectlog=n|sectsize=num,\n\
xfsprogs/mkfs/xfs_mkfs.h +3 -3
@@ -18,12 +18,12 @@#ifndef __XFS_MKFS_H__#define __XFS_MKFS_H__ -#define XFS_SB_VERSION_MKFS (ia,dia,extflag,dir2,log2,attr1,sflag,more) (\ - ((ia)||(dia)||(extflag)||(dir2)||(log2)||(attr1)||(sflag)||(more)) ? \ +#define XFS_SB_VERSION_MKFS (ia,dia,dir2,log2,attr1,sflag,more) (\ + ((ia)||(dia)||(dir2)||(log2)||(attr1)||(sflag)||(more)) ? \ ( XFS_SB_VERSION_4 | \ ((ia) ? XFS_SB_VERSION_ALIGNBIT : 0) | \ ((dia) ? XFS_SB_VERSION_DALIGNBIT : 0) | \ - ((extflag) ? XFS_SB_VERSION_EXTFLGBIT : 0) | \ + (XFS_SB_VERSION_EXTFLGBIT) | \ ((dir2) ? XFS_SB_VERSION_DIRV2BIT : 0) | \ ((log2) ? XFS_SB_VERSION_LOGV2BIT : 0) | \ ((attr1) ? XFS_SB_VERSION_ATTRBIT : 0) | \
Signature · 1 line
1.5.3.4
Quoted 1 line
From
a9b95cc4636501870155479787ec32b325afa512Mon Sep 17 00:00:00 2001
From: Niv Sardi <[email protected]>
Date: Tue, 30 Oct 2007 11:15:33 +1100
Subject: [PATCH] V2 inodes per default, and move DFL bits to XFS_DFL_SB_VERSION_BITS,
Activate XFS_SB_VERSION_NLINKBIT per default, witch will enable V2 INODES. refactor bits that we want everytime in XFS_DFL_SB_VERSION_BITS.
--- xfsprogs/mkfs/xfs_mkfs.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
xfsprogs/mkfs/xfs_mkfs.h +3 -1
@@ -18,17 +18,19 @@#ifndef __XFS_MKFS_H__#define __XFS_MKFS_H__ +#define XFS_DFL_SB_VERSION_BITS XFS_SB_VERSION_NLINKBIT|XFS_SB_VERSION_EXTFLGBIT +#define XFS_SB_VERSION_MKFS (ia,dia,dir2,log2,attr1,sflag,more) (\ ((ia)||(dia)||(dir2)||(log2)||(attr1)||(sflag)||(more)) ? \ ( XFS_SB_VERSION_4 | \ ((ia) ? XFS_SB_VERSION_ALIGNBIT : 0) | \ ((dia) ? XFS_SB_VERSION_DALIGNBIT : 0) | \ - (XFS_SB_VERSION_EXTFLGBIT) | \ ((dir2) ? XFS_SB_VERSION_DIRV2BIT : 0) | \ ((log2) ? XFS_SB_VERSION_LOGV2BIT : 0) | \ ((attr1) ? XFS_SB_VERSION_ATTRBIT : 0) | \ ((sflag) ? XFS_SB_VERSION_SECTORBIT : 0) | \ ((more) ? XFS_SB_VERSION_MOREBITSBIT : 0) | \ + XFS_DFL_SB_VERSION_BITS | \ 0 ) : XFS_SB_VERSION_1 )#define XFS_SB_VERSION2_MKFS (lazycount, attr2, parent) (\
Signature · 1 line
1.5.3.4
Quoted 1 line
From
c8e590185adb8b48e6765b9de7fe7afa19c6ea20Mon Sep 17 00:00:00 2001
From: Niv Sardi <[email protected]>
Date: Tue, 30 Oct 2007 12:26:35 +1100
Subject: [PATCH] reduce imaxpct for big filesystems,
imaxpct is set to 25% for FS < 1 TB,
then 5% for FS < 50 TB,
and then 1%.
It is implemented as a step function in calc_default_imaxpct()
--- xfsprogs/mkfs/xfs_mkfs.c | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-)
xfsprogs/mkfs/xfs_mkfs.c +17 -2
@@ -374,6 +374,21 @@ validate_log_size(__uint64_t logblocks, int blocklog, int min_logblocks) } } +int +calc_default_imaxpct ( +int blocklog, +__uint64_t dblocks) +{ +if (dblocks <TERABYTES (1 , blocklog)) { +return XFS_DFL_IMAXIMUM_PCT ; + }else if (dblocks <TERABYTES (50 , blocklog)) { +return 5 ; + } + +return 1 ; +} + + void calc_default_ag_geometry( int blocklog,
@@ -1986,7 +2001,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), dfile, isize, (long long )agcount, (long long )agsize,"" , sectorsize, attrversion,"" , blocksize, (long long )dblocks, - imflag ? imaxpct :XFS_DFL_IMAXIMUM_PCT , +calc_default_imaxpct (blocklog, dblocks),"" , dsunit, dswidth, dirversion, dirversion ==1 ? blocksize : dirblocksize, logfile, 1 << blocklog, (long long)logblocks,
@@ -2023,7 +2038,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), (__uint8_t)(rtextents ?libxfs_highbit32 ((unsigned int )rtextents) :0 ); sbp->sb_inprogress =1 ;/* mkfs is in progress */ - sbp->sb_imax_pct = imflag ? imaxpct :XFS_DFL_IMAXIMUM_PCT ; + sbp->sb_imax_pct =calc_default_imaxpct (blocklog, dblocks); sbp->sb_icount =0 ; sbp->sb_ifree =0 ; sbp->sb_fdblocks = dblocks - agcount * XFS_PREALLOC_BLOCKS(mp) -
Signature · 1 line
1.5.3.4
Quoted 1 line
From
bab3fed25bc5f44aef5b02af88a8ef968d08ddcbMon Sep 17 00:00:00 2001
From: Niv Sardi <[email protected]>
Date: Tue, 30 Oct 2007 12:26:35 +1100
Subject: [PATCH] less AGs for single disks configs.
This patch modifies get_subvol_stripe_wrapper() to return 0 on multi disk configs, <0 on error, and >0 on single disk configs (Ideally I'd like it to be able to return the count of disks or something more usefull).
it then uses the output of the new get_subvol_stripe_wrapper() in calc_default_ag_geometry() to get bigger AGs when in single disk configs (currently only x2 bigger).
--- xfsprogs/include/volume.h | 2 +- xfsprogs/libdisk/drivers.c | 15 ++++++++------- xfsprogs/mkfs/xfs_mkfs.c | 18 ++++++++++++------ 3 files changed, 21 insertions(+), 14 deletions(-)
xfsprogs/include/volume.h +1 -1
@@ -46,7 +46,7 @@ typedef enum sv_type_e {SVTYPE_LAST =255 } sv_type_t; -extern void get_subvol_stripe_wrapper (char *,sv_type_t ,int *,int *,int *); +extern int get_subvol_stripe_wrapper (char *,sv_type_t ,int *,int *,int *);extern int get_driver_block_major (const char *,int );#endif /* __VOLUME_H__ */
xfsprogs/libdisk/drivers.c +8 -7
@@ -18,7 +18,7 @@#include "drivers.h" -void +int get_subvol_stripe_wrapper( char *dev, sv_type_t type,
@@ -29,7 +29,7 @@ get_subvol_stripe_wrapper(struct stat64 sb;if (dev ==NULL ) -return ; +return -ENODEV ;if (stat64 (dev, &sb)) { fprintf(stderr, _("Cannot stat %s: %s\n"),
@@ -38,16 +38,17 @@ get_subvol_stripe_wrapper( }if (dm_get_subvol_stripe (dev, type, sunit, swidth, sectalign, &sb)) -return ; +return 0 ;if (md_get_subvol_stripe (dev, type, sunit, swidth, sectalign, &sb)) -return ; +return 0 ;if (lvm_get_subvol_stripe (dev, type, sunit, swidth, sectalign, &sb)) -return ; +return 0 ;if (xvm_get_subvol_stripe (dev, type, sunit, swidth, sectalign, &sb)) -return ; +return 0 ;if (evms_get_subvol_stripe (dev, type, sunit, swidth, sectalign, &sb)) -return ; +return 0 ; +return 1 ;/* ... add new device drivers here */ }
xfsprogs/mkfs/xfs_mkfs.c +12 -6
@@ -393,6 +393,7 @@ voidcalc_default_ag_geometry ( int blocklog, __uint64_t dblocks, + int dswidth, __uint64_t *agsize, __uint64_t *agcount) {
@@ -428,12 +429,13 @@ calc_default_ag_geometry(* * This scales us up smoothly between min/max AG sizes. */ +if (dblocks >GIGABYTES (512 , blocklog)) - shift =5 ; + shift =5 - (dswidth ==0 );else if (dblocks >GIGABYTES (8 , blocklog)) - shift =4 ; + shift =4 - (dswidth ==0 );else if (dblocks >=MEGABYTES (128 , blocklog)) - shift =3 ; + shift =3 - (dswidth ==0 );else ASSERT (0 ); blocks = dblocks >> shift;
@@ -1771,10 +1773,14 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"), agsize /= blocksize; agcount = dblocks / agsize + (dblocks % agsize !=0 ); - }else if (daflag)/* User-specified AG size */ + }else if (daflag)/* User-specified AG count */ agsize = dblocks / agcount + (dblocks % agcount !=0 ); -else -calc_default_ag_geometry (blocklog, dblocks, &agsize, &agcount); +else { +get_subvol_stripe_wrapper (dfile,SVTYPE_DATA , + &xlv_dsunit, &xlv_dswidth, §oralign); + +calc_default_ag_geometry (blocklog, dblocks, xlv_dswidth, &agsize, &agcount); + }/* * If the last AG is too small, reduce the filesystem size
Signature · 1 line
1.5.3.4
Oops, the last patch should have been this one, sorry for the noise.
Signature · 1 line
Niv
Quoted 1 line
From
1defd8358a7ee693176875ebc3a670a347c87d11Mon Sep 17 00:00:00 2001
From: Niv Sardi <[email protected]>
Date: Tue, 30 Oct 2007 12:26:35 +1100
Subject: [PATCH] less AGs for single disks configs.
This patch modifies get_subvol_stripe_wrapper() to return 0 on multi disk configs, <0 on error, and >0 on single disk configs (Ideally I'd like it to be able to return the count of disks or something more usefull).
it then uses the output of the new get_subvol_stripe_wrapper() in calc_default_ag_geometry() to get bigger AGs when in single disk configs (currently only x2 bigger).
--- xfsprogs/include/volume.h | 2 +- xfsprogs/libdisk/drivers.c | 15 ++++++++------- xfsprogs/mkfs/xfs_mkfs.c | 18 ++++++++++++------ 3 files changed, 21 insertions(+), 14 deletions(-)
xfsprogs/include/volume.h +1 -1
@@ -46,7 +46,7 @@ typedef enum sv_type_e {SVTYPE_LAST =255 } sv_type_t; -extern void get_subvol_stripe_wrapper (char *,sv_type_t ,int *,int *,int *); +extern int get_subvol_stripe_wrapper (char *,sv_type_t ,int *,int *,int *);extern int get_driver_block_major (const char *,int );#endif /* __VOLUME_H__ */
xfsprogs/libdisk/drivers.c +8 -7
@@ -18,7 +18,7 @@#include "drivers.h" -void +int get_subvol_stripe_wrapper( char *dev, sv_type_t type,
@@ -29,7 +29,7 @@ get_subvol_stripe_wrapper(struct stat64 sb;if (dev ==NULL ) -return ; +return -ENODEV ;if (stat64 (dev, &sb)) { fprintf(stderr, _("Cannot stat %s: %s\n"),
@@ -38,16 +38,17 @@ get_subvol_stripe_wrapper( }if (dm_get_subvol_stripe (dev, type, sunit, swidth, sectalign, &sb)) -return ; +return 0 ;if (md_get_subvol_stripe (dev, type, sunit, swidth, sectalign, &sb)) -return ; +return 0 ;if (lvm_get_subvol_stripe (dev, type, sunit, swidth, sectalign, &sb)) -return ; +return 0 ;if (xvm_get_subvol_stripe (dev, type, sunit, swidth, sectalign, &sb)) -return ; +return 0 ;if (evms_get_subvol_stripe (dev, type, sunit, swidth, sectalign, &sb)) -return ; +return 0 ; +return 1 ;/* ... add new device drivers here */ }
xfsprogs/mkfs/xfs_mkfs.c +12 -6
@@ -393,6 +393,7 @@ voidcalc_default_ag_geometry ( int blocklog, __uint64_t dblocks, + int singled, __uint64_t *agsize, __uint64_t *agcount) {
@@ -428,12 +429,13 @@ calc_default_ag_geometry(* * This scales us up smoothly between min/max AG sizes. */ +if (dblocks >GIGABYTES (512 , blocklog)) - shift =5 ; + shift =5 - (singled >0 );else if (dblocks >GIGABYTES (8 , blocklog)) - shift =4 ; + shift =4 - (singled >0 );else if (dblocks >=MEGABYTES (128 , blocklog)) - shift =3 ; + shift =3 - (singled >0 );else ASSERT (0 ); blocks = dblocks >> shift;
@@ -1771,10 +1773,14 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"), agsize /= blocksize; agcount = dblocks / agsize + (dblocks % agsize !=0 ); - }else if (daflag)/* User-specified AG size */ + }else if (daflag)/* User-specified AG count */ agsize = dblocks / agcount + (dblocks % agcount !=0 ); -else -calc_default_ag_geometry (blocklog, dblocks, &agsize, &agcount); +else { +calc_default_ag_geometry (blocklog, dblocks, +get_subvol_stripe_wrapper (dfile,SVTYPE_DATA , + &xlv_dsunit, &xlv_dswidth, §oralign), + &agsize, &agcount); + }/* * If the last AG is too small, reduce the filesystem size
Signature · 1 line
1.5.3.4
After discussing with dave, I changed my mind about the last patch, here's the updated version:
Cheers,
Signature · 1 line
Niv
Quoted 1 line
From
ce672e92543fa99199ed23fa934dedf8d678924eMon Sep 17 00:00:00 2001
From: Niv Sardi <[email protected]>
Date: Tue, 30 Oct 2007 12:26:35 +1100
Subject: [PATCH] less AGs for single disks configs.
get the underlying structure with get_subvol_stripe_wrapper(), and pass sunit | swidth as an argument to calc_default_ag_geometry().
if it is set, get the AG sizes bigger.
this also cleans up a typo:
- } else if (daflag) /* User-specified AG size */ + } else if (daflag) /* User-specified AG count */ --- xfsprogs/mkfs/xfs_mkfs.c | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-)
xfsprogs/mkfs/xfs_mkfs.c +12 -6
@@ -393,6 +393,7 @@ voidcalc_default_ag_geometry ( int blocklog, __uint64_t dblocks, + int multidisk, __uint64_t *agsize, __uint64_t *agcount) {
@@ -428,12 +429,13 @@ calc_default_ag_geometry(* * This scales us up smoothly between min/max AG sizes. */ +if (dblocks >GIGABYTES (512 , blocklog)) - shift =5 ; + shift =5 - (multidisk ==0 );else if (dblocks >GIGABYTES (8 , blocklog)) - shift =4 ; + shift =4 - (multidisk ==0 );else if (dblocks >=MEGABYTES (128 , blocklog)) - shift =3 ; + shift =3 - (multidisk ==0 );else ASSERT (0 ); blocks = dblocks >> shift;
@@ -1771,10 +1773,14 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"), agsize /= blocksize; agcount = dblocks / agsize + (dblocks % agsize !=0 ); - }else if (daflag)/* User-specified AG size */ + }else if (daflag)/* User-specified AG count */ agsize = dblocks / agcount + (dblocks % agcount !=0 ); -else -calc_default_ag_geometry (blocklog, dblocks, &agsize, &agcount); +else { +get_subvol_stripe_wrapper (dfile,SVTYPE_DATA , + &xlv_dsunit, &xlv_dswidth, §oralign), +calc_default_ag_geometry (blocklog, dblocks, xlv_dsunit | xlv_dswidth, + &agsize, &agcount); + }/* * If the last AG is too small, reduce the filesystem size
Signature · 1 line
1.5.3.4
Quoted 2 lines · Niv Sardi
Eric: mkfs.conf sounds like a great idea to me, but i don't think it should be exclusive to XFS.
It's not, ext[234] already has it :)
It'd have to be specific to each mkfs, I think, since each mkfs has its own knobs.
-Eric
No gnus is bad news ?
Shall I interpret the lack of comments as "everything is fine, just commit the damn thing ?"
Cheers,
Signature · 1 line
Niv
Quoted 3 lines · Niv Sardi
No gnus is bad news ?
Shall I interpret the lack of comments as "everything is fine, just commit the damn thing ?"
Lack of comments to what?
I haven't seen whatever patches you've sent which means wither you didn't tag the email as "[PATCH N/M]..." or "[REVIEW]..." and I didn't notice the attachments (nope, I see no patches in my archives of this thread) or, more likely, a spam filter along the way ate them. If you get no answer you resend the patches with [PATCH, RESEND] in the title....
Can you please resend all the patches you want reviewed as a patch per email?
Cheers,
Dave.
Signature · 3 lines
Dave Chinner Principal Engineer SGI Australian Software Group
PATCH RESEND 1/1 ] Default to log version 2
In reply to Niv SardiFrom: Niv Sardi <[email protected]>
--- xfsprogs/mkfs/xfs_mkfs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
xfsprogs/mkfs/xfs_mkfs.c +1 -1
@@ -686,7 +686,7 @@ main( ilflag = imflag = ipflag = isflag =0 ; liflag = laflag = lsflag = ldflag = lvflag =0 ; loginternal =1 ; - logversion =1 ; + logversion =2 ; logagno = logblocks = rtblocks = rtextblocks =0 ; Nflag = nlflag = nsflag = nvflag =0 ; dirblocklog = dirblocksize = dirversion =0 ;
Signature · 1 line
1.5.3.5
PATCH RESEND 1/1 ] Default to version 2 attributes.
From: Niv Sardi <[email protected]>
--- xfsprogs/mkfs/xfs_mkfs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
xfsprogs/mkfs/xfs_mkfs.c +1 -1
@@ -677,7 +677,7 @@ main(bindtextdomain (PACKAGE ,LOCALEDIR );textdomain (PACKAGE ); - attrversion =0 ; + attrversion =2 ; blflag = bsflag = slflag = ssflag = lslflag = lssflag =0 ; blocklog = blocksize =0 ; sectorlog = lsectorlog =XFS_MIN_SECTORSIZE_LOG ;
Signature · 1 line
1.5.3.5
PATCH RESEND 1/1 ] Drop the ability to turn unwritten extents off completly
From: Niv Sardi <[email protected]>
--- xfsprogs/mkfs/xfs_mkfs.c | 38 +++++++++++++------------------------- xfsprogs/mkfs/xfs_mkfs.h | 6 +++--- 2 files changed, 16 insertions(+), 28 deletions(-)
xfsprogs/mkfs/xfs_mkfs.c +13 -25
@@ -56,25 +56,23 @@ char *dopts[] = { "sunit",#define D_SWIDTH 5 "swidth", -#define D_UNWRITTEN 6 - "unwritten", -#define D_AGSIZE 7 +#define D_AGSIZE 6 "agsize", -#define D_SU 8 +#define D_SU 7 "su", -#define D_SW 9 +#define D_SW 8 "sw", -#define D_SECTLOG 10 +#define D_SECTLOG 9 "sectlog", -#define D_SECTSIZE 11 +#define D_SECTSIZE 10 "sectsize", -#define D_NOALIGN 12 +#define D_NOALIGN 11 "noalign", -#define D_RTINHERIT 13 +#define D_RTINHERIT 12 "rtinherit", -#define D_PROJINHERIT 14 +#define D_PROJINHERIT 13 "projinherit", -#define D_EXTSZINHERIT 15 +#define D_EXTSZINHERIT 14"extszinherit" , NULL };
@@ -604,7 +602,6 @@ main(int dsw;int dsunit;int dswidth; -int extent_flagging;int force_overwrite;struct fsxattr fsx;int iaflag;
@@ -697,7 +694,6 @@ main( dsize = logsize = rtsize = rtextsize = protofile =NULL ; dsu = dsw = dsunit = dswidth = lalign = lsu = lsunit =0 ; nodsflag = norsflag =0 ; - extent_flagging =1 ; force_overwrite =0 ; worst_freelist =0 ; lazy_sb_counters =0 ;
@@ -877,14 +873,6 @@ main( D_NOALIGN); nodsflag =1 ;break ; -case D_UNWRITTEN : -if (!value) -reqval ('d' , dopts,D_UNWRITTEN ); - c =atoi (value); -if (c <0 || c >1 ) -illegal (value,"d unwritten" ); - extent_flagging = c; -break ;case D_SECTLOG :if (!value)reqval ('d' , dopts,D_SECTLOG );
@@ -1990,7 +1978,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"),"meta-data=%-22s isize=%-6d agcount=%lld, agsize=%lld blks\n" " =%-22s sectsz=%-5u attr=%u\n" "data =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n" -" =%-22s sunit=%-6u swidth=%u blks, unwritten=%u\n" +" =%-22s sunit=%-6u swidth=%u blks\n" "naming =version %-14u bsize=%-6u\n" "log =%-22s bsize=%-6d blocks=%lld, version=%d\n" " =%-22s sectsz=%-5u sunit=%d blks, lazy-count=%d\n"
@@ -1999,7 +1987,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"),"" , sectorsize, attrversion,"" , blocksize, (long long )dblocks, imflag ? imaxpct :XFS_DFL_IMAXIMUM_PCT , -"" , dsunit, dswidth, extent_flagging, +"" , dsunit, dswidth, dirversion, dirversion ==1 ? blocksize : dirblocksize, logfile,1 << blocklog, (long long )logblocks, logversion, "", lsectorsize, lsunit, lazy_sb_counters,
@@ -2066,7 +2054,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), } sbp->sb_features2 =XFS_SB_VERSION2_MKFS (lazy_sb_counters, attrversion ==2 ,0 ); sbp->sb_versionnum =XFS_SB_VERSION_MKFS ( - iaflag, dsunit !=0 , extent_flagging, + iaflag, dsunit !=0 , dirversion ==2 , logversion ==2 , attrversion ==1 , (sectorsize !=BBSIZE || lsectorsize !=BBSIZE ), sbp->sb_features2 !=0 );
@@ -2537,7 +2525,7 @@ usage( void ) /* blocksize */ [-b log=n|size=num]\n\ /* data subvol */ [-d agcount=n,agsize=n,file,name=xxx,size=num,\n\ (sunit=value,swidth=value|su=num,sw=num),\n\ - sectlog=n|sectsize=num,unwritten=0|1]\n\ + sectlog=n|sectsize=num\n\ /* inode size */ [-i log=n|perblock=n|size=num,maxpct=n,attr=0|1|2]\n\ /* log subvol */ [-l agnum=n,internal,size=num,logdev=xxx,version=n\n\ sunit=value|su=num,sectlog=n|sectsize=num,\n\
xfsprogs/mkfs/xfs_mkfs.h +3 -3
@@ -18,12 +18,12 @@#ifndef __XFS_MKFS_H__#define __XFS_MKFS_H__ -#define XFS_SB_VERSION_MKFS (ia,dia,extflag,dir2,log2,attr1,sflag,more) (\ - ((ia)||(dia)||(extflag)||(dir2)||(log2)||(attr1)||(sflag)||(more)) ? \ +#define XFS_SB_VERSION_MKFS (ia,dia,dir2,log2,attr1,sflag,more) (\ + ((ia)||(dia)||(dir2)||(log2)||(attr1)||(sflag)||(more)) ? \ ( XFS_SB_VERSION_4 | \ ((ia) ? XFS_SB_VERSION_ALIGNBIT : 0) | \ ((dia) ? XFS_SB_VERSION_DALIGNBIT : 0) | \ - ((extflag) ? XFS_SB_VERSION_EXTFLGBIT : 0) | \ + (XFS_SB_VERSION_EXTFLGBIT) | \ ((dir2) ? XFS_SB_VERSION_DIRV2BIT : 0) | \ ((log2) ? XFS_SB_VERSION_LOGV2BIT : 0) | \ ((attr1) ? XFS_SB_VERSION_ATTRBIT : 0) | \
Signature · 1 line
1.5.3.5
PATCH RESEND 1/1 ] V2 inodes per default, and move DFL bits to XFS_DFL_SB_VERSION_BITS,
From: Niv Sardi <[email protected]>
Activate XFS_SB_VERSION_NLINKBIT per default, witch will enable V2 INODES. refactor bits that we want everytime in XFS_DFL_SB_VERSION_BITS.
--- xfsprogs/mkfs/xfs_mkfs.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
xfsprogs/mkfs/xfs_mkfs.h +3 -1
@@ -18,17 +18,19 @@#ifndef __XFS_MKFS_H__#define __XFS_MKFS_H__ +#define XFS_DFL_SB_VERSION_BITS XFS_SB_VERSION_NLINKBIT|XFS_SB_VERSION_EXTFLGBIT +#define XFS_SB_VERSION_MKFS (ia,dia,dir2,log2,attr1,sflag,more) (\ ((ia)||(dia)||(dir2)||(log2)||(attr1)||(sflag)||(more)) ? \ ( XFS_SB_VERSION_4 | \ ((ia) ? XFS_SB_VERSION_ALIGNBIT : 0) | \ ((dia) ? XFS_SB_VERSION_DALIGNBIT : 0) | \ - (XFS_SB_VERSION_EXTFLGBIT) | \ ((dir2) ? XFS_SB_VERSION_DIRV2BIT : 0) | \ ((log2) ? XFS_SB_VERSION_LOGV2BIT : 0) | \ ((attr1) ? XFS_SB_VERSION_ATTRBIT : 0) | \ ((sflag) ? XFS_SB_VERSION_SECTORBIT : 0) | \ ((more) ? XFS_SB_VERSION_MOREBITSBIT : 0) | \ + XFS_DFL_SB_VERSION_BITS | \ 0 ) : XFS_SB_VERSION_1 )#define XFS_SB_VERSION2_MKFS (lazycount, attr2, parent) (\
Signature · 1 line
1.5.3.5
PATCH RESEND 1/1 ] reduce imaxpct for big filesystems,
From: Niv Sardi <[email protected]>
imaxpct is set to 25% for FS < 1 TB,
then 5% for FS < 50 TB,
and then 1%.
It is implemented as a step function in calc_default_imaxpct()
--- xfsprogs/mkfs/xfs_mkfs.c | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-)
xfsprogs/mkfs/xfs_mkfs.c +17 -2
@@ -374,6 +374,21 @@ validate_log_size(__uint64_t logblocks, int blocklog, int min_logblocks) } } +int +calc_default_imaxpct ( +int blocklog, +__uint64_t dblocks) +{ +if (dblocks <TERABYTES (1 , blocklog)) { +return XFS_DFL_IMAXIMUM_PCT ; + }else if (dblocks <TERABYTES (50 , blocklog)) { +return 5 ; + } + +return 1 ; +} + + void calc_default_ag_geometry( int blocklog,
@@ -1986,7 +2001,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), dfile, isize, (long long )agcount, (long long )agsize,"" , sectorsize, attrversion,"" , blocksize, (long long )dblocks, - imflag ? imaxpct :XFS_DFL_IMAXIMUM_PCT , +calc_default_imaxpct (blocklog, dblocks),"" , dsunit, dswidth, dirversion, dirversion ==1 ? blocksize : dirblocksize, logfile, 1 << blocklog, (long long)logblocks,
@@ -2023,7 +2038,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), (__uint8_t)(rtextents ?libxfs_highbit32 ((unsigned int )rtextents) :0 ); sbp->sb_inprogress =1 ;/* mkfs is in progress */ - sbp->sb_imax_pct = imflag ? imaxpct :XFS_DFL_IMAXIMUM_PCT ; + sbp->sb_imax_pct =calc_default_imaxpct (blocklog, dblocks); sbp->sb_icount =0 ; sbp->sb_ifree =0 ; sbp->sb_fdblocks = dblocks - agcount * XFS_PREALLOC_BLOCKS(mp) -
Signature · 1 line
1.5.3.5
PATCH RESEND 1/1 ] less AGs for single disks configs.
From: Niv Sardi <[email protected]>
get the underlying structure with get_subvol_stripe_wrapper(), and pass sunit | swidth as an argument to calc_default_ag_geometry().
if it is set, get the AG sizes bigger.
this also cleans up a typo:
- } else if (daflag) /* User-specified AG size */ + } else if (daflag) /* User-specified AG count */ --- xfsprogs/mkfs/xfs_mkfs.c | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-)
xfsprogs/mkfs/xfs_mkfs.c +12 -6
@@ -393,6 +393,7 @@ voidcalc_default_ag_geometry ( int blocklog, __uint64_t dblocks, + int multidisk, __uint64_t *agsize, __uint64_t *agcount) {
@@ -428,12 +429,13 @@ calc_default_ag_geometry(* * This scales us up smoothly between min/max AG sizes. */ +if (dblocks >GIGABYTES (512 , blocklog)) - shift =5 ; + shift =5 - (multidisk ==0 );else if (dblocks >GIGABYTES (8 , blocklog)) - shift =4 ; + shift =4 - (multidisk ==0 );else if (dblocks >=MEGABYTES (128 , blocklog)) - shift =3 ; + shift =3 - (multidisk ==0 );else ASSERT (0 ); blocks = dblocks >> shift;
@@ -1771,10 +1773,14 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"), agsize /= blocksize; agcount = dblocks / agsize + (dblocks % agsize !=0 ); - }else if (daflag)/* User-specified AG size */ + }else if (daflag)/* User-specified AG count */ agsize = dblocks / agcount + (dblocks % agcount !=0 ); -else -calc_default_ag_geometry (blocklog, dblocks, &agsize, &agcount); +else { +get_subvol_stripe_wrapper (dfile,SVTYPE_DATA , + &xlv_dsunit, &xlv_dswidth, §oralign), +calc_default_ag_geometry (blocklog, dblocks, xlv_dsunit | xlv_dswidth, + &agsize, &agcount); + }/* * If the last AG is too small, reduce the filesystem size
Signature · 1 line
1.5.3.5
Re: [[PATCH, RESEND]] less AGs for single disks configs.
xfsprogs/mkfs/xfs_mkfs.c _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"), · line 1776
Quoted 10 lines · On Mon, Nov 12, 2007 at 02:48:49PM +1100, [email protected] wrote:
From: Niv Sardi <[email protected]>
get the underlying structure with
get_subvol_stripe_wrapper(), and pass sunit | swidth as an argument tocalc_default_ag_geometry().if it is set, get the AG sizes bigger.
this also cleans up a typo:
xfsprogs/mkfs/xfs_mkfs.c +1
-1- }else if (daflag)/* User-specified AG size */ + }else if (daflag)/* User-specified AG count */
No need to mention that you are cleaning up a typo in the description ;)
Quoted 22 lines
--- xfsprogs/mkfs/xfs_mkfs.c | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-)xfsprogs/mkfs/xfs_mkfs.c +2
-0@@ -393,6 +393,7 @@ voidcalc_default_ag_geometry ( int blocklog, __uint64_t dblocks, + int multidisk, __uint64_t *agsize, __uint64_t *agcount) {@@ -428,12 +429,13 @@ calc_default_ag_geometry(* * This scales us up smoothly between min/max AG sizes. */ +if (dblocks >GIGABYTES (512 , blocklog))
xfsprogs/mkfs/xfs_mkfs.c calc_default_ag_geometry( · line 440
Quoted 10 lines
xfsprogs/mkfs/xfs_mkfs.c +3
-3- shift =5 ; + shift =5 - (multidisk ==0 ); else if (dblocks > GIGABYTES(8, blocklog)) - shift =4 ; + shift =4 - (multidisk ==0 ); else if (dblocks >= MEGABYTES(128, blocklog)) - shift =3 ; + shift =3 - (multidisk ==0 ); else ASSERT(0);
Ok, so now we end up with half the number of allocation groups at these different sizes. That's not exactly what I had in mind. basically, what you've done works out as:
> 512GB old = 32 AGs, new = 16AGs > 8 GB old = 16 AGs, new = 8AGs > 128MB old = 8 AGs, new = 4AGs
on an 8Gb filesystem we still get 8 AGs, which is far too many. on a 750GB disk, we still get 16AGs, which to far too many.
A single spindle, regardless of it's size, will have similar seek characteristics so scaling the number of AGs with size is the wrong thing to do - you don't get better parallelism out of a single spindle, just more seeks and lower performance. hence keeping the number of AGs fixed up to the point where the AG size tops out (i.e. 4TB) seems like a better scaling factor to me. i.e. something like:
if (!multidisk) {
if (dblocks >= TERABYTES(4, blocklog)) {
blocks = XFS_AG_MAX_BLOCKS(blocklog);
goto done;
}
agcount = 4;
/* work out ag size here */
goto done;
}I'd also like to see some test results showing the mkfs output for the different configurations to confirm it works correctly (i.e. that the corner cases work correctly).
Cheers,
Dave.
Signature · 3 lines
Dave Chinner Principal Engineer SGI Australian Software Group
Re: [[PATCH, RESEND]] less AGs for single disks configs.
Quoted 77 lines · David Chinner
xfsprogs/mkfs/xfs_mkfs.c _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"), · line 1776
Quoted 10 lines · On Mon, Nov 12, 2007 at 02:48:49PM +1100, [email protected] wrote:
From: Niv Sardi <[email protected]>
get the underlying structure with
get_subvol_stripe_wrapper(), and pass sunit | swidth as an argument tocalc_default_ag_geometry().if it is set, get the AG sizes bigger.
this also cleans up a typo:
xfsprogs/mkfs/xfs_mkfs.c +1
-1- }else if (daflag)/* User-specified AG size */ + }else if (daflag)/* User-specified AG count */ No need to mention that you are cleaning up a typo in the description ;)
Quoted 22 lines
--- xfsprogs/mkfs/xfs_mkfs.c | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-)xfsprogs/mkfs/xfs_mkfs.c +2
-0@@ -393,6 +393,7 @@ voidcalc_default_ag_geometry ( int blocklog, __uint64_t dblocks, + int multidisk, __uint64_t *agsize, __uint64_t *agcount) {@@ -428,12 +429,13 @@ calc_default_ag_geometry(* * This scales us up smoothly between min/max AG sizes. */ +if (dblocks >GIGABYTES (512 , blocklog))xfsprogs/mkfs/xfs_mkfs.c calc_default_ag_geometry( · line 440
Quoted 10 lines
xfsprogs/mkfs/xfs_mkfs.c +3
-3- shift =5 ; + shift =5 - (multidisk ==0 ); else if (dblocks > GIGABYTES(8, blocklog)) - shift =4 ; + shift =4 - (multidisk ==0 ); else if (dblocks >= MEGABYTES(128, blocklog)) - shift =3 ; + shift =3 - (multidisk ==0 ); else ASSERT(0);Ok, so now we end up with half the number of allocation groups at these different sizes. That's not exactly what I had in mind. basically, what you've done works out as:
> 512GB old = 32 AGs, new = 16AGs > 8 GB old = 16 AGs, new = 8AGs > 128MB old = 8 AGs, new = 4AGson an 8Gb filesystem we still get 8 AGs, which is far too many. on a 750GB disk, we still get 16AGs, which to far too many.
A single spindle, regardless of it's size, will have similar seek characteristics so scaling the number of AGs with size is the wrong thing to do - you don't get better parallelism out of a single spindle, just more seeks and lower performance. hence keeping the number of AGs fixed up to the point where the AG size tops out (i.e. 4TB) seems like a better scaling factor to me. i.e. something like:
if (!multidisk) { if (dblocks >= TERABYTES(4, blocklog)) { blocks = XFS_AG_MAX_BLOCKS(blocklog); goto done; } agcount = 4; /* work out ag size here */ goto done; }
Quoted 13 lines
I'd also like to see some test results showing the mkfs output for the different configurations to confirm it works correctly (i.e. that the corner cases work correctly).
Cheers,
Dave.
Signature · 3 lines
Dave Chinner Principal Engineer SGI Australian Software Group
Dave, when this is put into place do you recommend people re-format their XFS partitions for those with a 750GiB drive -or- with a < 2TB RAID5 array, would one see any increase in speed?
Justin.
Re: [[PATCH, RESEND]] less AGs for single disks configs.
Quoted 20 lines · Justin Piszcz
Quoted 19 lines · David Chinner
A single spindle, regardless of it's size, will have similar seek characteristics so scaling the number of AGs with size is the wrong thing to do - you don't get better parallelism out of a single spindle, just more seeks and lower performance. hence keeping the number of AGs fixed up to the point where the AG size tops out (i.e. 4TB) seems like a better scaling factor to me. i.e. something like:
if (!multidisk) { if (dblocks >= TERABYTES(4, blocklog)) { blocks = XFS_AG_MAX_BLOCKS(blocklog); goto done; } agcount = 4; /* work out ag size here */ goto done; }
Quoted 7 lines
Quoted 3 lines
I'd also like to see some test results showing the mkfs output for the different configurations to confirm it works correctly (i.e. that the corner cases work correctly).
Dave, when this is put into place do you recommend people re-format their XFS partitions for those with a 750GiB drive -or- with a < 2TB RAID5 array,
No. If you are having performance problems, then changing the way the filesystem is laid out *may* improve performance but if everything is working fine then don't change it.
Quoted 1 line
would one see any increase in speed?
On a single disk, yes. On RAID5 - who knows. There are so many other variables to raid5 performance (esp software raid) that such single disk optimisations could degrade performance. On other RAID hardware, it might improve - it really depends on the RAID implementation....
Cheers,
Dave.
Signature · 3 lines
Dave Chinner Principal Engineer SGI Australian Software Group
Re: [[PATCH, RESEND]] reduce imaxpct for big filesystems,
In reply to [email protected]Quoted 16 lines · On Mon, Nov 12, 2007 at 02:48:48PM +1100, [email protected] wrote:
From: Niv Sardi <[email protected]>
imaxpct is set to 25% for FS < 1 TB,
then 5% for FS < 50 TB,
and then 1%.It is implemented as a step function in
calc_default_imaxpct()--- xfsprogs/mkfs/xfs_mkfs.c | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-)xfsprogs/mkfs/xfs_mkfs.c +0
-0
xfsprogs/mkfs/xfs_mkfs.c validate_log_size(__uint64_t logblocks, int blocklog, int min_logblocks) · line 378
Quoted 5 lines
xfsprogs/mkfs/xfs_mkfs.c +2
-0@@ -374,6 +374,21 @@ validate_log_size(__uint64_t logblocks, int blocklog, int min_logblocks) } } +int +calc_default_imaxpct(
static int
xfsprogs/mkfs/xfs_mkfs.c validate_log_size(__uint64_t logblocks, int blocklog, int min_logblocks) · line 389
Quoted 11 lines
xfsprogs/mkfs/xfs_mkfs.c +11
-0+ int blocklog, + __uint64_t dblocks) +{ +if (dblocks <TERABYTES (1 , blocklog)) { +return XFS_DFL_IMAXIMUM_PCT ; + }else if (dblocks <TERABYTES (50 , blocklog)) { +return 5 ; + } + +return 1 ; +}
Comment explaining what it is doing? (i.e. what I had to explain to you in the first place ;).
Cheers,
Dave.
Signature · 3 lines
Dave Chinner Principal Engineer SGI Australian Software Group
Re: [[PATCH, RESEND]] V2 inodes per default, and move DFL bits to XFS_DFL_SB_VERSION_BITS,
In reply to [email protected]Quoted 4 lines · On Mon, Nov 12, 2007 at 02:48:47PM +1100, [email protected] wrote:
From: Niv Sardi <[email protected]>
Activate
XFS_SB_VERSION_NLINKBITper default, witch will enable V2 INODES. refactor bits that we want everytime inXFS_DFL_SB_VERSION_BITS.
Yay! A description ;)
s/witch/which/
Quoted 9 lines
--- xfsprogs/mkfs/xfs_mkfs.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)xfsprogs/mkfs/xfs_mkfs.h +0
-0
xfsprogs/mkfs/xfs_mkfs.h line 22
Quoted 5 lines
xfsprogs/mkfs/xfs_mkfs.h +2
-0@@ -18,17 +18,19 @@#ifndef __XFS_MKFS_H__#define __XFS_MKFS_H__ +#define XFS_DFL_SB_VERSION_BITS XFS_SB_VERSION_NLINKBIT|XFS_SB_VERSION_EXTFLGBIT +
I suggest splitting this over multiple lines and calling it XFS_DEFAULT_SB_VERSION_BITS.
#define XFS_DEFAULT_SB_VERSION_BITS \ (XFS_SB_VERSION_NLINKBIT | \ XFS_SB_VERSION_EXTFLGBIT)
Cheers,
Dave.
Signature · 3 lines
Dave Chinner Principal Engineer SGI Australian Software Group
Re: [[PATCH, RESEND]] V2 inodes per default, and move DFL bits to XFS_DFL_SB_VERSION_BITS,
Quoted 3 lines · David Chinner
On Mon, Nov 12, 2007 at 02:48:47PM +1100, [email protected] wrote:
I suggest splitting this over multiple lines and calling itXFS_DEFAULT_SB_VERSION_BITS.
The rest of the file labels defaults as DFL, I feel it's better to keep it that way.
Signature · 1 line
Niv
Re: [[PATCH, RESEND]] Drop the ability to turn unwritten extents off completly
In reply to [email protected]Quoted 2 lines · On Mon, Nov 12, 2007 at 02:48:46PM +1100, [email protected] wrote:
From: Niv Sardi <[email protected]>
This needs a good description for why it's being removed and the man pages need updating. (e.g. mkfs.xfs)
The code looks good, but NACK until the man page updates is done as well.
Cheers,
dave.
Signature · 3 lines
Dave Chinner Principal Engineer SGI Australian Software Group
Re: [[PATCH, RESEND]] Default to version 2 attributes.
In reply to [email protected]Quoted 2 lines · On Mon, Nov 12, 2007 at 02:48:45PM +1100, [email protected] wrote:
From: Niv Sardi <[email protected]>
Description?
Quoted 9 lines
--- xfsprogs/mkfs/xfs_mkfs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)xfsprogs/mkfs/xfs_mkfs.c +0
-0
xfsprogs/mkfs/xfs_mkfs.c main( · line 683
Quoted 8 lines
xfsprogs/mkfs/xfs_mkfs.c +1
-1@@ -677,7 +677,7 @@ main(bindtextdomain (PACKAGE ,LOCALEDIR );textdomain (PACKAGE ); - attrversion =0 ; + attrversion =2 ; blflag = bsflag = slflag = ssflag = lslflag = lssflag =0 ; blocklog = blocksize =0 ; sectorlog = lsectorlog =XFS_MIN_SECTORSIZE_LOG ;
ok.
Cheers,
Dave.
Signature · 3 lines
Dave Chinner Principal Engineer SGI Australian Software Group
Re: [[PATCH, RESEND]] Default to log version 2
In reply to [email protected]Quoted 2 lines · On Mon, Nov 12, 2007 at 02:48:44PM +1100, [email protected] wrote:
From: Niv Sardi <[email protected]>
Description?
Quoted 9 lines
--- xfsprogs/mkfs/xfs_mkfs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)xfsprogs/mkfs/xfs_mkfs.c +0
-0
xfsprogs/mkfs/xfs_mkfs.c main( · line 692
Quoted 8 lines
xfsprogs/mkfs/xfs_mkfs.c +1
-1@@ -686,7 +686,7 @@ main( ilflag = imflag = ipflag = isflag =0 ; liflag = laflag = lsflag = ldflag = lvflag =0 ; loginternal =1 ; - logversion =1 ; + logversion =2 ; logagno = logblocks = rtblocks = rtextblocks =0 ; Nflag = nlflag = nsflag = nvflag =0 ; dirblocklog = dirblocksize = dirversion =0 ;
ok.
Cheers,
Dave.
Signature · 3 lines
Dave Chinner Principal Engineer SGI Australian Software Group
RESEND(2)
In reply to Niv SardiAdded descriptions to first patches,
Added extended description for unwritten extents, updated manpages. Refactored XFS_DFL_SB_VERSION_BITS as suggested by dave. Added in-code description for reduced imaxpct for big filesystems.
made calc_default_imaxpct stati, as suggested by dave.
Removed mention to cleaning typos ;)
implemented new logics as suggested by dave.
PATCH 1/6 Default to log version 2
From: Niv Sardi <[email protected]>
Change logversion to 2 in xfs_mkfs.c
--- xfsprogs/mkfs/xfs_mkfs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
xfsprogs/mkfs/xfs_mkfs.c +1 -1
@@ -686,7 +686,7 @@ main( ilflag = imflag = ipflag = isflag =0 ; liflag = laflag = lsflag = ldflag = lvflag =0 ; loginternal =1 ; - logversion =1 ; + logversion =2 ; logagno = logblocks = rtblocks = rtextblocks =0 ; Nflag = nlflag = nsflag = nvflag =0 ; dirblocklog = dirblocksize = dirversion =0 ;
Signature · 1 line
1.5.3.5
PATCH 2/6 Default to version 2 attributes.
From: Niv Sardi <[email protected]>
Change attrversion from 0 to 2 in xfs_mkfs.c
--- xfsprogs/mkfs/xfs_mkfs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
xfsprogs/mkfs/xfs_mkfs.c +1 -1
@@ -677,7 +677,7 @@ main(bindtextdomain (PACKAGE ,LOCALEDIR );textdomain (PACKAGE ); - attrversion =0 ; + attrversion =2 ; blflag = bsflag = slflag = ssflag = lslflag = lssflag =0 ; blocklog = blocksize =0 ; sectorlog = lsectorlog =XFS_MIN_SECTORSIZE_LOG ;
Signature · 1 line
1.5.3.5
PATCH 3/6 Drop the ability to turn unwritten extents off completly
From: Niv Sardi <[email protected]>
unwritten extents on linux are generally a bad idea, this option should not be used.
Remove the mount option from xfs_mkfs.c:
remove it from option list,
remove it from mkfs output.
Update xfs.mkfs manpage.
--- xfsprogs/doc/CHANGES | 1 + xfsprogs/growfs/xfs_growfs.c | 11 ++++------- xfsprogs/man/man8/mkfs.xfs.8 | 16 ---------------- xfsprogs/man/man8/xfs_admin.8 | 3 ++- xfsprogs/mkfs/xfs_mkfs.c | 38 +++++++++++++------------------------- xfsprogs/mkfs/xfs_mkfs.h | 6 +++--- 6 files changed, 23 insertions(+), 52 deletions(-)
xfsprogs/doc/CHANGES +1 -0
@@ -5,6 +5,7 @@ xfsprogs-2.9.x warning in certain device sizes. - Man page fixes. Thanks to Utako Kusaka <[email protected]> for this. + - Disable the ability to turn off unwritten extents in mkfs. xfsprogs-2.9.4 (7 Sep 2007) - Fixed xfs_repair segfaulting with directory block size different
xfsprogs/growfs/xfs_growfs.c +4 -7
@@ -58,7 +58,6 @@ report_info(int isint, char *logname, char *rtname, - int unwritten, int lazycount, int dirversion, int logversion,
@@ -68,7 +67,7 @@ report_info("meta-data=%-22s isize=%-6u agcount=%u, agsize=%u blks\n" " =%-22s sectsz=%-5u attr=%u\n" "data =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n" -" =%-22s sunit=%-6u swidth=%u blks, unwritten=%u\n" +" =%-22s sunit=%-6u swidth=%u blks" "naming =version %-14u bsize=%-6u\n" "log =%-22s bsize=%-6u blocks=%u, version=%u\n" " =%-22s sectsz=%-5u sunit=%u blks, lazy-count=%u\n"
@@ -78,7 +77,7 @@ report_info("" , geo.sectsize, attrversion,"" , geo.blocksize, (unsigned long long )geo.datablocks, geo.imaxpct, -"" , geo.sunit, geo.swidth, unwritten, +"" , geo.sunit, geo.swidth, dirversion, geo.dirblocksize, isint ?_ ("internal" ) : logname ? logname :_ ("external" ), geo.blocksize, geo.logblocks, logversion,
@@ -115,7 +114,6 @@ main(int argc, char **argv)xfs_fsop_geom_t ngeo;/* new fs geometry */ int rflag;/* -r flag */ long long rsize;/* new rt size in fs blocks */ -int unwritten;/* unwritten extent flag */ int lazycount;/* lazy superblock counters */ int xflag;/* -x flag */ char *fname;/* mount point name */
@@ -236,7 +234,6 @@ main(int argc, char **argv) } } isint = geo.logstart >0 ; - unwritten = geo.flags &XFS_FSOP_GEOM_FLAGS_EXTFLG ?1 :0 ; lazycount = geo.flags &XFS_FSOP_GEOM_FLAGS_LAZYSB ?1 :0 ; dirversion = geo.flags &XFS_FSOP_GEOM_FLAGS_DIRV2 ?2 :1 ; logversion = geo.flags &XFS_FSOP_GEOM_FLAGS_LOGV2 ?2 :1 ;
@@ -245,7 +242,7 @@ main(int argc, char **argv)if (nflag) {report_info (geo, datadev, isint, logdev, rtdev, - unwritten, lazycount, dirversion, logversion, + lazycount, dirversion, logversion, attrversion);exit (0 ); }
@@ -282,7 +279,7 @@ main(int argc, char **argv) }report_info (geo, datadev, isint, logdev, rtdev, - unwritten, lazycount, dirversion, logversion, + lazycount, dirversion, logversion, attrversion); ddsize = xi.dsize;
xfsprogs/man/man8/mkfs.xfs.8 +0 -16
@@ -240,22 +240,6 @@ will automatically query the logical volume for appropriate and .B swidth values. -.TP -.BI unwritten[= value ] -This is used to specify whether unwritten extents are flagged as such, -or not. -The -.I value -is either 0 or 1, with 1 signifying that unwritten -extent flagging should occur. -If the suboption is omitted, unwritten extent flagging is enabled. -If unwritten extents are flagged, filesystem write performance -will be negatively affected for preallocated file extents, since -extra filesystem transactions are required to convert extent flags -for the range of the file written. -This suboption should be disabled if the filesystem -needs to be used on operating system versions which do not support the -flagging capability. .RE .TP .B \-f
xfsprogs/man/man8/xfs_admin.8 +2 -1
@@ -31,7 +31,8 @@ command. .TP .B \-e Enables unwritten extent support on a filesystem that does not -already have this enabled. +already have this enabled (for legacy filesystems, it can't be +disabled anymore at mkfs time). .TP .B \-f Specifies that the filesystem image to be processed is stored in a
xfsprogs/mkfs/xfs_mkfs.c +13 -25
@@ -56,25 +56,23 @@ char *dopts[] = { "sunit",#define D_SWIDTH 5 "swidth", -#define D_UNWRITTEN 6 - "unwritten", -#define D_AGSIZE 7 +#define D_AGSIZE 6 "agsize", -#define D_SU 8 +#define D_SU 7 "su", -#define D_SW 9 +#define D_SW 8 "sw", -#define D_SECTLOG 10 +#define D_SECTLOG 9 "sectlog", -#define D_SECTSIZE 11 +#define D_SECTSIZE 10 "sectsize", -#define D_NOALIGN 12 +#define D_NOALIGN 11 "noalign", -#define D_RTINHERIT 13 +#define D_RTINHERIT 12 "rtinherit", -#define D_PROJINHERIT 14 +#define D_PROJINHERIT 13 "projinherit", -#define D_EXTSZINHERIT 15 +#define D_EXTSZINHERIT 14"extszinherit" , NULL };
@@ -604,7 +602,6 @@ main(int dsw;int dsunit;int dswidth; -int extent_flagging;int force_overwrite;struct fsxattr fsx;int iaflag;
@@ -697,7 +694,6 @@ main( dsize = logsize = rtsize = rtextsize = protofile =NULL ; dsu = dsw = dsunit = dswidth = lalign = lsu = lsunit =0 ; nodsflag = norsflag =0 ; - extent_flagging =1 ; force_overwrite =0 ; worst_freelist =0 ; lazy_sb_counters =0 ;
@@ -877,14 +873,6 @@ main( D_NOALIGN); nodsflag =1 ;break ; -case D_UNWRITTEN : -if (!value) -reqval ('d' , dopts,D_UNWRITTEN ); - c =atoi (value); -if (c <0 || c >1 ) -illegal (value,"d unwritten" ); - extent_flagging = c; -break ;case D_SECTLOG :if (!value)reqval ('d' , dopts,D_SECTLOG );
@@ -1990,7 +1978,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"),"meta-data=%-22s isize=%-6d agcount=%lld, agsize=%lld blks\n" " =%-22s sectsz=%-5u attr=%u\n" "data =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n" -" =%-22s sunit=%-6u swidth=%u blks, unwritten=%u\n" +" =%-22s sunit=%-6u swidth=%u blks\n" "naming =version %-14u bsize=%-6u\n" "log =%-22s bsize=%-6d blocks=%lld, version=%d\n" " =%-22s sectsz=%-5u sunit=%d blks, lazy-count=%d\n"
@@ -1999,7 +1987,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"),"" , sectorsize, attrversion,"" , blocksize, (long long )dblocks, imflag ? imaxpct :XFS_DFL_IMAXIMUM_PCT , -"" , dsunit, dswidth, extent_flagging, +"" , dsunit, dswidth, dirversion, dirversion ==1 ? blocksize : dirblocksize, logfile,1 << blocklog, (long long )logblocks, logversion, "", lsectorsize, lsunit, lazy_sb_counters,
@@ -2066,7 +2054,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), } sbp->sb_features2 =XFS_SB_VERSION2_MKFS (lazy_sb_counters, attrversion ==2 ,0 ); sbp->sb_versionnum =XFS_SB_VERSION_MKFS ( - iaflag, dsunit !=0 , extent_flagging, + iaflag, dsunit !=0 , dirversion ==2 , logversion ==2 , attrversion ==1 , (sectorsize !=BBSIZE || lsectorsize !=BBSIZE ), sbp->sb_features2 !=0 );
@@ -2537,7 +2525,7 @@ usage( void ) /* blocksize */ [-b log=n|size=num]\n\ /* data subvol */ [-d agcount=n,agsize=n,file,name=xxx,size=num,\n\ (sunit=value,swidth=value|su=num,sw=num),\n\ - sectlog=n|sectsize=num,unwritten=0|1]\n\ + sectlog=n|sectsize=num\n\ /* inode size */ [-i log=n|perblock=n|size=num,maxpct=n,attr=0|1|2]\n\ /* log subvol */ [-l agnum=n,internal,size=num,logdev=xxx,version=n\n\ sunit=value|su=num,sectlog=n|sectsize=num,\n\
xfsprogs/mkfs/xfs_mkfs.h +3 -3
@@ -18,12 +18,12 @@#ifndef __XFS_MKFS_H__#define __XFS_MKFS_H__ -#define XFS_SB_VERSION_MKFS (ia,dia,extflag,dir2,log2,attr1,sflag,more) (\ - ((ia)||(dia)||(extflag)||(dir2)||(log2)||(attr1)||(sflag)||(more)) ? \ +#define XFS_SB_VERSION_MKFS (ia,dia,dir2,log2,attr1,sflag,more) (\ + ((ia)||(dia)||(dir2)||(log2)||(attr1)||(sflag)||(more)) ? \ ( XFS_SB_VERSION_4 | \ ((ia) ? XFS_SB_VERSION_ALIGNBIT : 0) | \ ((dia) ? XFS_SB_VERSION_DALIGNBIT : 0) | \ - ((extflag) ? XFS_SB_VERSION_EXTFLGBIT : 0) | \ + (XFS_SB_VERSION_EXTFLGBIT) | \ ((dir2) ? XFS_SB_VERSION_DIRV2BIT : 0) | \ ((log2) ? XFS_SB_VERSION_LOGV2BIT : 0) | \ ((attr1) ? XFS_SB_VERSION_ATTRBIT : 0) | \
Signature · 1 line
1.5.3.5
PATCH 4/6 V2 inodes per default, and move DFL bits to XFS_DFL_SB_VERSION_BITS,
From: Niv Sardi <[email protected]>
Activate XFS_SB_VERSION_NLINKBIT per default, which will enable V2 INODES. refactor bits that we want everytime in XFS_DFL_SB_VERSION_BITS.
--- xfsprogs/mkfs/xfs_mkfs.h | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
xfsprogs/mkfs/xfs_mkfs.h +5 -1
@@ -18,17 +18,21 @@#ifndef __XFS_MKFS_H__#define __XFS_MKFS_H__ +#define XFS_DFL_SB_VERSION_BITS \ + (XFS_SB_VERSION_NLINKBIT | \ + XFS_SB_VERSION_EXTFLGBIT) +#define XFS_SB_VERSION_MKFS (ia,dia,dir2,log2,attr1,sflag,more) (\ ((ia)||(dia)||(dir2)||(log2)||(attr1)||(sflag)||(more)) ? \ ( XFS_SB_VERSION_4 | \ ((ia) ? XFS_SB_VERSION_ALIGNBIT : 0) | \ ((dia) ? XFS_SB_VERSION_DALIGNBIT : 0) | \ - (XFS_SB_VERSION_EXTFLGBIT) | \ ((dir2) ? XFS_SB_VERSION_DIRV2BIT : 0) | \ ((log2) ? XFS_SB_VERSION_LOGV2BIT : 0) | \ ((attr1) ? XFS_SB_VERSION_ATTRBIT : 0) | \ ((sflag) ? XFS_SB_VERSION_SECTORBIT : 0) | \ ((more) ? XFS_SB_VERSION_MOREBITSBIT : 0) | \ + XFS_DFL_SB_VERSION_BITS | \ 0 ) : XFS_SB_VERSION_1 )#define XFS_SB_VERSION2_MKFS (lazycount, attr2, parent) (\
Signature · 1 line
1.5.3.5
PATCH 5/6 reduce imaxpct for big filesystems,
From: Niv Sardi <[email protected]>
imaxpct is set to 25% (XFS_DFL_IMAXIMUM_PCT) for FS < 1 TB, then 5% for FS < 50 TB,
and then (over 50 TB) 1%.
It is implemented as a simple step function in calc_default_imaxpct()
--- xfsprogs/mkfs/xfs_mkfs.c | 27 +++++++++++++++++++++++++-- 1 files changed, 25 insertions(+), 2 deletions(-)
xfsprogs/mkfs/xfs_mkfs.c +25 -2
@@ -374,6 +374,29 @@ validate_log_size(__uint64_t logblocks, int blocklog, int min_logblocks) } } +static int +calc_default_imaxpct ( +int blocklog, +__uint64_t dblocks) +{ +/* +* This returns the % of the disk space that is used for +* inodes, it changes relatively to the FS size: +* - over 50 TB, use 1%, +* - 1TB - 50 TB, use 5%, +* - under 1 TB, use XFS_DFL_IMAXIMUM_PCT (25%). +*/ + +if (dblocks <TERABYTES (1 , blocklog)) { +return XFS_DFL_IMAXIMUM_PCT ; + }else if (dblocks <TERABYTES (50 , blocklog)) { +return 5 ; + } + +return 1 ; +} + + void calc_default_ag_geometry( int blocklog,
@@ -1986,7 +2009,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), dfile, isize, (long long )agcount, (long long )agsize,"" , sectorsize, attrversion,"" , blocksize, (long long )dblocks, - imflag ? imaxpct :XFS_DFL_IMAXIMUM_PCT , +calc_default_imaxpct (blocklog, dblocks),"" , dsunit, dswidth, dirversion, dirversion ==1 ? blocksize : dirblocksize, logfile, 1 << blocklog, (long long)logblocks,
@@ -2023,7 +2046,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), (__uint8_t)(rtextents ?libxfs_highbit32 ((unsigned int )rtextents) :0 ); sbp->sb_inprogress =1 ;/* mkfs is in progress */ - sbp->sb_imax_pct = imflag ? imaxpct :XFS_DFL_IMAXIMUM_PCT ; + sbp->sb_imax_pct =calc_default_imaxpct (blocklog, dblocks); sbp->sb_icount =0 ; sbp->sb_ifree =0 ; sbp->sb_fdblocks = dblocks - agcount * XFS_PREALLOC_BLOCKS(mp) -
Signature · 1 line
1.5.3.5
PATCH 6/6 less AGs for single disks configs.
From: Niv Sardi <[email protected]>
get the underlying structure with get_subvol_stripe_wrapper(), and pass sunit | swidth as an argument to calc_default_ag_geometry().
if it is set, we are in single disk, get XFS_AG_MAX_BLOCKS for FS >= 4TB, and calculate ag numbers regarding to that.
get 4 AGs for FS < 4TB.
we calculate according to blocks or count if we have them, add an assert to ensure we have one of the 2.
--- xfsprogs/mkfs/xfs_mkfs.c | 28 ++++++++++++++++++++++++---- 1 files changed, 24 insertions(+), 4 deletions(-)
xfsprogs/mkfs/xfs_mkfs.c +24 -4
@@ -401,10 +401,11 @@ voidcalc_default_ag_geometry ( int blocklog, __uint64_t dblocks, + int multidisk, __uint64_t *agsize, __uint64_t *agcount) { - __uint64_t blocks; + __uint64_t blocks = 0;__uint64_t count =0 ;int shift =0 ;
@@ -436,6 +437,17 @@ calc_default_ag_geometry(* * This scales us up smoothly between min/max AG sizes. */ + +if (!multidisk) { +if (dblocks >=TERABYTES (4 , blocklog)) { + blocks =XFS_AG_MAX_BLOCKS (blocklog); + goto done; + } + count =4 ; + + goto done; + } +if (dblocks >GIGABYTES (512 , blocklog)) shift =5 ;else if (dblocks >GIGABYTES (8 , blocklog))
@@ -447,8 +459,12 @@ calc_default_ag_geometry( blocks = dblocks >> shift; done: +ASSERT (count || blocks);if (!count) count = dblocks / blocks + (dblocks % blocks !=0 ); +if (!blocks) + blocks = dblocks / count; + *agsize = blocks; *agcount = count; }
@@ -1779,10 +1795,14 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"), agsize /= blocksize; agcount = dblocks / agsize + (dblocks % agsize !=0 ); - }else if (daflag)/* User-specified AG size */ + }else if (daflag)/* User-specified AG count */ agsize = dblocks / agcount + (dblocks % agcount !=0 ); -else -calc_default_ag_geometry (blocklog, dblocks, &agsize, &agcount); +else { +get_subvol_stripe_wrapper (dfile,SVTYPE_DATA , + &xlv_dsunit, &xlv_dswidth, §oralign), +calc_default_ag_geometry (blocklog, dblocks, xlv_dsunit | xlv_dswidth, + &agsize, &agcount); + }/* * If the last AG is too small, reduce the filesystem size
Signature · 1 line
1.5.3.5
Re: RESEND(2)
In reply to [email protected]Quoted 8 lines · On Tue, Nov 13, 2007 at 03:10:51PM +1100, [email protected] wrote:
Added descriptions to first patches,
Added extended description for unwritten extents, updated manpages. RefactoredXFS_DFL_SB_VERSION_BITSas suggested by dave. Added in-code description for reduced imaxpct for big filesystems.
madecalc_default_imaxpctstati, as suggested by dave.
Removed mention to cleaning typos ;)
implemented new logics as suggested by dave.
All looks ok now, Niv. Good work.
Cheers,
Dave.
Signature · 3 lines
Dave Chinner Principal Engineer SGI Australian Software Group