Whamcloud - gitweb
LU-5106 readdir: improve striped readdir 63/27663/6
authorLai Siyao <lai.siyao@intel.com>
Thu, 15 Jun 2017 16:03:10 +0000 (00:03 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 19 Jul 2017 03:28:59 +0000 (03:28 +0000)
commit98fc9a77446a1539bca18215ad57f21712218ecc
tree0ef4aced5a8c14e4c81ae24e9aff88d9a1f8eda8
parent9e7952c045a3ce2041a2fa325cc4a147be6549bb
LU-5106 readdir: improve striped readdir

Striped directory needs to build its directory page from sub-stripe
directory pages, current code iterate sub stripe directory pages
to search dirent for each hash, this is inefficient, as may cause
statahead fail because statahead thread is slow in readdir, while
'ls' is faster and can't find cached statahead entries, and finally
cause statahead fail.

This patch introduces a struct lmv_dir_ctxt which saves dir page and
current dirent for all stripes, to find the dirent which has the
closest hash value it only needs to compare the dirent of all stripes,
and then pop this dirent from its stripe, until all stripes reache
the end.

This patch contains another fix: previously LDP_COLLIDE is set by
default, change to set dir page end hash 'ldp_hash_end' to hash
of next dirent, and only set LDP_COLLIDE when 'ldp_hash_end' equals
last dirent hash 'lde_hash'. We should avoid dir hash collision.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Change-Id: I99c33ea3c55772d3bb77571dcdc67312d386fa27
Reviewed-on: https://review.whamcloud.com/27663
Tested-by: Jenkins
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lmv/lmv_obd.c