[LU-6544] Improve mkfs.lustre --stripe-count-hint inode size calculation for ldiskfs Created: 29/Apr/15  Updated: 12/May/16  Resolved: 03/Aug/15

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.5.3, Lustre 2.8.0
Fix Version/s: Lustre 2.8.0

Type: Bug Priority: Minor
Reporter: Andreas Dilger Assignee: Emoly Liu
Resolution: Fixed Votes: 0
Labels: easy

Issue Links:
Related
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Running mkfs.lustre --stripe-count-hint=N should tune the ldiskfs inode size to allow files with N stripes to fit the lov layout xattr into the inode rather than storing it in an external xattr block (which reduces performance and significantly increases the space used per file on the MDT). However, I think that with newer xattrs such as lma may not be taken into account in the default stripe calculations.



 Comments   
Comment by Emoly Liu [ 20/May/15 ]

Andreas, the current inode_size calculation is shown in the following:

                /* Inode size (for extended attributes).  The LOV EA size is
                 * 32 (EA hdr) + 32 (lov_mds_md) + stripes * 24 (lov_ost_data),
                 * and we want some margin above that for ACLs, other EAs... */
                if (strstr(mop->mo_mkfsopts, "-I") == NULL) {
                        if (IS_MDT(&mop->mo_ldd)) {
                                if (mop->mo_stripe_count > 72)
                                        inode_size = 512; /* bz 7241 */
                                /* see also "-i" below for EA blocks */
                                else if (mop->mo_stripe_count > 32)
                                        inode_size = 2048;
                                else if (mop->mo_stripe_count > 10)
                                        inode_size = 1024;
                                else
                                        inode_size = 512;

If I understand the new requirement right, no matter what stripe_count=N the user sets, we should fit lma and all current xattrs into the inode size. The the calculation looks like

156(ldiskfs_inode_size) + 24(lma) + 32(lov EA hdr) + 32 (lov_mds_md) + 24(lov_ost_data) * N <= 512*2^m {m=0,1,2,3}

And m can't be bigger than 3 (at this situation inode size will be 4096bytes), and the biggest value of N is 160, right?

Comment by Andreas Dilger [ 23/Jun/15 ]

It looks like the previous limits were leaving a small amount of free space at each step (about 12 bytes), but it would be better to reduce the limits to 8, 30, 72 so there is a small amount of space reserved for other xattrs (ACL, etc) in the inode.

Comment by Gerrit Updater [ 20/Jul/15 ]

Emoly Liu (emoly.liu@intel.com) uploaded a new patch: http://review.whamcloud.com/15643
Subject: LU-6544 mkfs: Reduce mkfs.lustre --stripe-count-hint limits
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 0e2e2ede4eaba5aa66c2436e39c713aa8a95d0c5

Comment by Gerrit Updater [ 03/Aug/15 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/15643/
Subject: LU-6544 mkfs: Improve MDT inode size calculation
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 71b3cc3315114b2101bc32707fa66740279fff54

Comment by Peter Jones [ 03/Aug/15 ]

Landed for 2.8

Generated at Sat Feb 10 02:01:08 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.