Bug 1236272

Summary: socket: Use newer system calls that provide better interface/performance on Linux/*BSD when available
Product: [Community] GlusterFS Reporter: krishnan parthasarathi <kparthas>
Component: transportAssignee: Milind Changire <mchangir>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: mainlineCC: atumball, bugs, rgowdapp, smohan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-6.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-25 16:30:11 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:
Embargoed:

Description krishnan parthasarathi 2015-06-27 06:06:17 UTC
Description of problem:
New system calls have been introduced in Linux/NetBSD that provide improved performance/interface. e.g accept4(2) in GNU/Linux makes it possible to set O_NONBLOCK flag on the socket fd saving an additional fcntl(2) for the same. paccept(2) provides the same functionality for NetBSD. This bug tracks the patches that make use of these newer interfaces without breaking compatibility with systems running older kernels.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Anand Avati 2015-06-27 06:07:02 UTC
REVIEW: http://review.gluster.org/11304 (socket: set FD_CLOEXEC on all sockets) posted (#3) for review on master by Krishnan Parthasarathi (kparthas)

Comment 2 Anand Avati 2015-07-04 04:06:57 UTC
REVIEW: http://review.gluster.org/11241 (socket: use accept4/paccept for nonblocking sockets) posted (#7) for review on master by Krishnan Parthasarathi (kparthas)

Comment 3 Anand Avati 2015-07-27 04:54:24 UTC
REVIEW: http://review.gluster.org/11241 (socket: use accept4/paccept for nonblocking sockets) posted (#9) for review on master by Krishnan Parthasarathi (kparthas)

Comment 6 Mike McCune 2016-03-28 23:43:17 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 7 Amar Tumballi 2018-10-08 10:03:56 UTC
Not sure if it makes sense, but good to take this to closure! Marking it back to 'assigned' as the patch is abandon'd.

Comment 8 Milind Changire 2018-10-08 17:00:16 UTC
The accept path is definitely not a performance problem without this fix. So there's not much incentive to get this done.

Gluster client connections are expected to be few and long lived.

I'd want Raghavendra to comment on this as well.

Comment 9 Raghavendra G 2018-10-09 02:04:06 UTC
Yes. This is not much of a concern ATM. But if the patch is available and can be closed off quickly, makes sense to merge it. @Milind, can you please review the patch once?

Comment 10 Worker Ant 2018-10-09 05:49:58 UTC
REVIEW: https://review.gluster.org/11304 (socket: set FD_CLOEXEC on all sockets) posted (#4) for review on master by Milind Changire

Comment 11 Worker Ant 2018-10-11 05:16:09 UTC
COMMIT: https://review.gluster.org/11304 committed in master by "Raghavendra G" <rgowdapp> with a commit message- socket: set FD_CLOEXEC on all sockets

For more information, see http://udrepper.livejournal.com/20407.html

BUG: 1236272
Change-Id: I25a645c10bdbe733a81d53cb714eb036251f8129
fixes: bz#1236272
Signed-off-by: Krishnan Parthasarathi <kparthas>

Comment 12 Worker Ant 2018-10-11 08:38:18 UTC
REVIEW: https://review.gluster.org/11241 (socket: use accept4/paccept for nonblocking socket) posted (#10) for review on master by Milind Changire

Comment 13 Worker Ant 2018-10-12 02:12:11 UTC
COMMIT: https://review.gluster.org/11241 committed in master by "Raghavendra G" <rgowdapp> with a commit message- socket: use accept4/paccept for nonblocking socket

This reduces the no. of syscalls on Linux systems from 2, accept(2) and
fcntl(2) for setting O_NONBLOCK, to a single accept4(2).  On NetBSD, we
have paccept(2) that does the same, if we leave signal masking aside.

Added sys_accept which accepts an extra flags argument than accept(2).
This would opportunistically use accept4/paccept as available.  It would
fallback to accept(2) and fcntl(2) otherwise.

While at this, the patch sets FD_CLOEXEC flag on the accepted socket fd.

BUG: 1236272
Change-Id: I41e43fd3e36d6dabb07e578a1cea7f45b7b4e37f
fixes: bz#1236272
Signed-off-by: Krishnan Parthasarathi <kparthas>

Comment 14 Shyamsundar 2019-03-25 16:30:11 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-6.0, please open a new bug report.

glusterfs-6.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.

[1] https://lists.gluster.org/pipermail/announce/2019-March/000120.html
[2] https://www.gluster.org/pipermail/gluster-users/