From: Fan Yong Date: Sun, 21 Apr 2013 02:46:12 +0000 (+0800) Subject: LU-3015 osd-zfs: Fix a typo in udmu_objs_count_estimate X-Git-Tag: 2.4.51~74 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=90ec4d3168fea4017be05c418bd6942df429f959 LU-3015 osd-zfs: Fix a typo in udmu_objs_count_estimate The typo is relatively straightforward given the diff below. It leads to larger-than-actual average dnode size estimations, which further causes overly conservative os_ffree (number of available objects) values. For example, without this patch, os_ffree values for "empty" 1 GB ZFS-based MDT/OSTs look like: [root@linux tests]# df -h Filesystem Size Used Avail Use% Mounted on [...] lustre-mdt1/mdt1 929M 3.0M 924M 1% /mnt/mds1 lustre-ost1/ost1 929M 1.3M 926M 1% /mnt/ost1 lustre-ost2/ost2 929M 1.3M 926M 1% /mnt/ost2 linux@tcp:/lustre 1.9G 2.5M 1.9G 1% /mnt/lustre [root@linux tests]# df -i Filesystem Inodes IUsed IFree IUse% Mounted on [...] lustre-mdt1/mdt1 7583 178 7405 3% /mnt/mds1 lustre-ost1/ost1 7631 212 7419 3% /mnt/ost1 lustre-ost2/ost2 7631 212 7419 3% /mnt/ost2 linux@tcp:/lustre 7583 178 7405 3% /mnt/lustre With this patch, they look like: [root@linux tests]# df -h Filesystem Size Used Avail Use% Mounted on [...] lustre-mdt1/mdt1 929M 2.9M 924M 1% /mnt/mds1 lustre-ost1/ost1 929M 1.3M 926M 1% /mnt/ost1 lustre-ost2/ost2 929M 1.3M 926M 1% /mnt/ost2 linux@tcp:/lustre 1.9G 2.5M 1.9G 1% /mnt/lustre [root@linux tests]# df -i Filesystem Inodes IUsed IFree IUse% Mounted on [...] lustre-mdt1/mdt1 161966 178 161788 1% /mnt/mds1 lustre-ost1/ost1 223825 212 223613 1% /mnt/ost1 lustre-ost2/ost2 223825 212 223613 1% /mnt/ost2 linux@tcp:/lustre 161966 178 161788 1% /mnt/lustre Only after fixing this typo could we evaluate how the intented estimation algorithm works. Test-Parameters: mdsfilesystemtype=zfs ostfilesystemtype=zfs mdtfilesystemtype=zfs Signed-off-by: Li Wei Signed-off-by: Fan Yong Change-Id: Ic3cbe569261d2c0e4338001c47f3dd64c621621a Reviewed-on: http://review.whamcloud.com/5806 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: Andreas Dilger Reviewed-by: Johann Lombardi --- diff --git a/lustre/osd-zfs/udmu.c b/lustre/osd-zfs/udmu.c index 2a5a783..69408b3 100644 --- a/lustre/osd-zfs/udmu.c +++ b/lustre/osd-zfs/udmu.c @@ -198,7 +198,7 @@ static uint64_t udmu_objs_count_estimate(uint64_t refdbytes, CLASSERT(OSD_DNODE_EST_BLKSHIFT > 0); est_refdblocks = (refdbytes >> SPA_MAXBLOCKSHIFT) + - (OSD_DNODE_EST_COUNT << OSD_DNODE_EST_BLKSHIFT); + (OSD_DNODE_EST_COUNT >> OSD_DNODE_EST_BLKSHIFT); est_usedobjs = usedobjs + OSD_DNODE_EST_COUNT; /* Average space/dnode more than maximum dnode size, use max dnode