RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1048731 - pthread_cond_timedwait latency
Summary: pthread_cond_timedwait latency
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glibc
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: 7.2
Assignee: Carlos O'Donell
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-06 09:28 UTC by wq
Modified: 2017-01-11 18:27 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-11 18:27:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
the test.c for this problem (703 bytes, text/plain)
2014-01-06 09:28 UTC, wq
no flags Details

Description wq 2014-01-06 09:28:31 UTC
Created attachment 845976 [details]
the test.c for this problem

Description of problem:
pthread_cond_timedwait has 70us latency when the arg "abstime" has already expired


Version-Release number of selected component (if applicable):
RHEL6.3/RHEL6.4/RHEL7

How reproducible:
every time

Steps to Reproduce:
1.gcc test.c -lpthread -lrt -o test
2../test

Actual results:
cond wait spend time: 0.000063058

Expected results:
if the abstime has already expired, it should return -ETIMEOUT immediatly, rather than do  syscall "futex_wait"

Additional info:
   As I know, this problem only occurred in x86_64, because x86_64's pthread_cond_timedwait.S has this patch "http://repo.or.cz/w/glibc.git/commit/e88726b483a275824e852f64476087568dbae7bb", i386 do not has this patch. But in glibc-2.18 (Fedora koji) i386 use this patch too.
   I'm confused, why this improvement low my performance.

Comment 10 Florian Weimer 2016-01-26 15:08:34 UTC
If we perform the comparison in user space with a clocK_gettime vDSO call, the non-expired case will suffer.  I'm not sure if there is a way to improve performance across the board, and which case is more important.

Comment 12 Torvald Riegel 2017-01-11 18:27:54 UTC
The associated upstream bug has been closed as RESOLVED WONTFIX, so I'm closing this bug as well for the same reason (though with the resolution NOTABUG, which the upstream bug tracker doesn't offer; it is not a bug).  See this comment for more details about the reasons for this decision:
https://sourceware.org/bugzilla/show_bug.cgi?id=16410#c3


Note You need to log in before you can comment on or make changes to this bug.