Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1519598

Summary: Reduce lock contention on protocol client manipulating fd
Product: [Community] GlusterFS Reporter: Zhang Huan <zhhuan>
Component: protocolAssignee: bugs <bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: glusterfs-4.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-15 11:22:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Zhang Huan 2017-12-01 01:30:23 UTC
Description of problem:

Current use of a per-client mutex to protect fdctx introduces lock contentions when there are dozens of file operations active.

Need to break the lock down and use finer grain spinlock to reduce contention.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:

Actual results:

Expected results:

Additional info:

Comment 1 Worker Ant 2017-12-01 01:34:41 UTC
REVIEW: (protocol/client: reduce lock contention) posted (#1) for review on master by Zhang Huan

Comment 2 Zhang Huan 2017-12-01 02:02:40 UTC
This issue focusing on client side lock contention when manipulating fd. It is a follow-up contention fix of the server side fdtable lookup ( 

These two patches are better to work together. Here are a few numbers of w/ and w/o the two patches. Tested by fio with 8 concurrency via fuse mount. Only one brick is configured and ramdisk is used as storage. client and server side event threads are all set to 4.
	          seqread 1MB	seqwrite 1MB	randread 4KB	randwrite 4KB
w/o patch 1	       883	     505	  13.5	         22.3
w/o patch 2	       954	     503	  14.3	         25.1
w/ patch 1	       973	     526	  14.2	         25.4
w/ patch 2	       974	     531	  14.4	         25.4

Comment 3 Worker Ant 2017-12-26 05:06:27 UTC
COMMIT: committed in master by \"Zhang Huan\" <> with a commit message- protocol/client: reduce lock contention

Current use of a per-client mutex to protect fdctx introduces lock
contentions when there are dozens of file operations active.

Use finer grain spinlock to reduce contention, and put retrieving
fdctx out of lock.

Change-Id: Iea3e2eb481e76a5d73a582ba81529180c5b88248
BUG: 1519598
Signed-off-by: Zhang Huan <>

Comment 4 Shyamsundar 2018-03-15 11:22:12 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-4.0.0, please open a new bug report.

glusterfs-4.0.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.