Whamcloud - gitweb
LU-14139 statahead: batched statahead processing 20/40720/37
authorQian Yingjin <qian@ddn.com>
Fri, 20 Nov 2020 10:38:02 +0000 (18:38 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 11 Apr 2023 20:04:38 +0000 (20:04 +0000)
commit4435d0121f72aac3ad01c98a33b265a496359890
tree6f262eb65896b1c485e06d4f7935eb8587d0afec
parent1c8a49bedff274677594833cb4958027c6b338db
LU-14139 statahead: batched statahead processing

Batched metadata processing can get a big performance boost.
In this patch, it implements a batched statahead mechanism which
can also increase the performance for a directory traverse or
listing such as the command 'ls'.

For the batched statahead, one batch getattr() RPC equals to
'N' normal lookup/getattr RPCs. It can pack a number of dentry
name getting from the readdir() call and prepared lock handles
one client side lock namespace into one large batched RPC
transfering via bulk I/O to obtain ibits DLM locks and
associated attributes for a lot of files in one blow.
When MDS receives a batched getattr() RPC, it executes the sub
requests in it one by one serially.

A tunable parameter named "statahead_batch_max" is defined, it
means the maximal items can be batched and processed within one
aggregate RPC. Once the number of sub requests exceeds this
predefined limit, it will pack and trigger the batched RPC.
The batched RPC will also be triggered explictly when the
readdir() call comes to the end position of the directory or
the statahead thread exits abnormally.

Batched metadata processing can get a big performance boost.
The mdtest performance results without/with this patch series are
as follow:
mdtest-easy-stat      720.562369 kIOPS : time 118.695 seconds
mdtest-easy-stat     1218.290192 kIOPS : time 70.656 seconds

In this patch, we set statahead_batch_max=0 and disabled batched
statahead by default. It will enable accordingly once some
subsequent fixes about batched RPC have been merged.

Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: I5a80c2c377093dc8b8e21341f440e3038f017ca8
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/40720
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
21 files changed:
lustre/include/lustre_dlm.h
lustre/include/lustre_req_layout.h
lustre/include/obd.h
lustre/ldlm/ldlm_lockd.c
lustre/ldlm/ldlm_request.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/lproc_llite.c
lustre/llite/statahead.c
lustre/lmv/lmv_obd.c
lustre/mdc/mdc_batch.c
lustre/mdc/mdc_dev.c
lustre/mdc/mdc_internal.h
lustre/mdc/mdc_locks.c
lustre/mdt/mdt_batch.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_lib.c
lustre/osc/osc_request.c
lustre/ptlrpc/layout.c
lustre/quota/qsd_request.c
lustre/target/tgt_handler.c