Whamcloud - gitweb
LU-4906 llite: read page from LMV/MDC for readdir 22/10622/8
authorWang Di <di.wang@intel.com>
Fri, 6 Jun 2014 08:49:37 +0000 (01:49 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 17 Jun 2014 14:48:56 +0000 (14:48 +0000)
commitdee25c13da7c50c5d3279803bdd315e20863a533
treeb4061aff1423fbc10110912c494f3a55caa53d50
parent2ade2c4e1481c4bacf49e871cbd299cfc2ccc3b3
LU-4906 llite: read page from LMV/MDC for readdir

This patch will change readdir iteration from read entry to read
page. During rm -rf, the statahead thread will enqueue the lock for
each entry in mdc_read_entry, in the mean time, MDT will revoke
the lock when it deletes each entry, which causes ldlm lock ping
pong behavior, and a lot extra RPC.

With this patch, llite will read one page from MDC each time, then
stat ahead thread will hold the page and do getattr for all entries
in this page. Note: it does not need to hold ldlm lock after it
get the page, because stat ahead thread can live with -ENOENT
or ESTALE, if the entry becomes stale during this time.

With this patch, the performance of "rm -rf" will be improved
for current master.

1. without this patch on master

[root@mds tests]# ./createmany -o /mnt/lustre/test1/f- 10000
total: 10000 creates in 11.98 seconds: 835.02 creates/second
[root@mds tests]# ls /mnt/lustre/test1/ | wc
  10000   10000   68890
[root@mds tests]# time rm -rf /mnt/lustre/test1

real 1m4.496s
user 0m0.014s
sys 0m3.832s

2. with this patch on master

[root@mds tests]# ./createmany -o /mnt/lustre/test1/f- 10000
total: 10000 creates in 11.72 seconds: 853.50 creates/second
[root@mds tests]# time rm -rf /mnt/lustre/test1

real 0m8.151s
user 0m0.012s
sys 0m2.242s

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I189f0039b5624455b70d1381b43d452cc8766543
Reviewed-on: http://review.whamcloud.com/10622
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
12 files changed:
lustre/include/lclient.h
lustre/include/lustre_mdc.h
lustre/include/obd.h
lustre/include/obd_class.h
lustre/liblustre/dir.c
lustre/llite/dir.c
lustre/llite/llite_internal.h
lustre/llite/llite_nfs.c
lustre/llite/statahead.c
lustre/lmv/lmv_obd.c
lustre/mdc/mdc_request.c
lustre/obdclass/lprocfs_status.c