Whamcloud - gitweb
LU-12151 osd-ldiskfs: pass owner down rather than transfer it 81/34581/3
authorWang Shilong <wshilong@ddn.com>
Wed, 3 Apr 2019 09:13:16 +0000 (17:13 +0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 13 Apr 2019 04:50:20 +0000 (04:50 +0000)
commit697f2d95bfdca13565ccc5d50e106114604c1724
treeaef318fde0b2fa59bed2f8c6c54a8e7650dc337d
parente774b6729235888965158fd7a4a556fe47fb1b45
LU-12151 osd-ldiskfs: pass owner down rather than transfer it

Currently, for object creation, initially uid/gid set as 0,
and then osd_quota_trasfer() is called to correct space accounting
for non-root users, function call is like:

|->osd_create
  |->osd_create_type_f
     |->osd_mkreg
        |->ldiskfs_create_inode
           |->ext4_new_inode() ->owner as NULL, create 0 as uid/gid
      |->osd_attr_init
         |->osd_quota_transfer  ->which will change uid/gid again for above.

This is inefficient since osd_quota_transfer() is a more
heavy operations, we could just pass downer owner(uid,gid),
project quota will inherit from its' parents automatically
when creating inode.

Some distros ext4 still did not support passing @owner down,
that is (rhel6,sles11) we just added extra @owner arg in
ldiskfs_create_inode() to make build system happy, and we
could add similar support to older kernel if that is really needed.

Command:
 $ salloc -N 32 --ntasks-per-node=24 mpirun -np 768 mdtest -n 2000
-F -u -d <mnt>

Without Patch:
Users Speed
root 175741.938 ops/sec
non-root  108631.673 ops/sec

Patched:
Users Speed
root 184775.286 ops/sec
non-root  185218.466 ops/sec

Patch improved ~80% for non-root users and we reached
same speed for both root and non-root users.

Change-Id: I57b0d2a6913268448c0ed90cfe76bd9f051b0b40
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/34581
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
ldiskfs/kernel_patches/patches/rhel6.3/ext4-osd-iop-common.patch
ldiskfs/kernel_patches/patches/rhel7.6/ext4-osd-iop-common.patch
ldiskfs/kernel_patches/patches/rhel7/ext4-osd-iop-common.patch
ldiskfs/kernel_patches/patches/sles11sp2/ext4-osd-iop-common.patch
ldiskfs/kernel_patches/patches/sles12sp2/ext4-osd-iop-common.patch
ldiskfs/kernel_patches/patches/ubuntu18/ext4-osd-iop-common.patch
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_oi.c