Whamcloud - gitweb
EX-2455 pcc: check first before set PCC-RO on a file
authorQian Yingjin <qian@ddn.com>
Fri, 5 Feb 2021 03:48:26 +0000 (11:48 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 26 Mar 2021 18:01:59 +0000 (18:01 +0000)
commitc88de7605764cb362e0706f6dbbc3ae21354538a
treec981df103d76534139c53227e64c1b7be5fab3aa
parent07d1bffe0ca589354cfd906de893c9cbca1f39b4
EX-2455 pcc: check first before set PCC-RO on a file

In this patch, MDT takes a CR layout lock against the file object
first to check whether the file is already PCC-RO cached. If so,
return immediately; Otherwise, take an EX lock on the file to
update the FLR PCC-RO state accordingly. By this check, it can
avoid heavy lock contention and unnecessary revocation of the
layout lock granted to the other clients when multiple processes
from many clients perform read-only attach on a shared file
simultaneously.

It also adds the layout intent write (LAYOUT_INTENT_PCCRO_SET
and LAYOUT_INTENT_PCCRO_CLEAR) with FMODE_WRITE flag, so that
the conflict lock can be revoked via the ELC strategy, avoiding
unnecessary lock traffic.

Test-Parameters: clientcount=3 testlist=sanity-pcc,sanity-pcc,sanity-pcc
Change-Id: Id01ea69335ad8ad46bade356327644e0dfb571cc
Signed-off-by: Qian Yingjin <qian@ddn.com>
Reviewed-on: https://review.whamcloud.com/41926
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/include/dt_object.h
lustre/include/md_object.h
lustre/include/obd_support.h
lustre/llite/file.c
lustre/llite/pcc.c
lustre/lod/lod_object.c
lustre/mdd/mdd_internal.h
lustre/mdd/mdd_object.c
lustre/mdt/mdt_handler.c
lustre/tests/sanity-pcc.sh