Whamcloud - gitweb
LU-10499 pcc: check first before set PCC-RO on a file 70/54370/8
authorQian Yingjin <qian@ddn.com>
Fri, 5 Feb 2021 03:48:26 +0000 (11:48 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 8 Jul 2024 20:09:05 +0000 (20:09 +0000)
commitb09d33ed8e47c33b3c2af7b8d70f78ff72882f20
treecd3aaa91d39854ab5742ce295b7def63c0710113
parente4c01fbcc54179712544e48b3b5db2be8c80e4cc
LU-10499 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.

EX-bug-id: EX-2455
Test-Parameters: clientcount=3 testlist=sanity-pcc,sanity-pcc,sanity-pcc
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: If59315abe444917f8a890b60a38c239b8ee045bf
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54370
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.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/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