From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25593 invoked by alias); 5 Nov 2012 16:51:23 -0000 Received: (qmail 25576 invoked by uid 22791); 5 Nov 2012 16:51:22 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Nov 2012 16:51:18 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qA5GpHV0016029 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 5 Nov 2012 11:51:17 -0500 Received: from spoyarek (vpn-229-45.phx2.redhat.com [10.3.229.45]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qA5GpE51021895; Mon, 5 Nov 2012 11:51:15 -0500 Date: Mon, 05 Nov 2012 16:51:00 -0000 From: Siddhesh Poyarekar To: libc-ports@sourceware.org Cc: libc-alpha@sourceware.org Subject: [ports] Use FUTEX_WAIT_BITSET for timed futex operations Message-ID: <20121105222021.49d68f30@spoyarek> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2012-11/txt/msg00016.txt.bz2 Hi, The x86 implementations of these functions have long used FUTEX_WAIT_BITSET instead of FUTEX_WAIT to wait in the futex system call for timed operations like pthread_cond_timedwait, pthread_rwlock_timed*lock and friends. FUTEX_WAIT_BITSET does not need the additional computation of relative timeout in the function, which gets converted back into an absolute timeout in the kernel. As a result, FUTEX_WAIT_BITSET is faster than FUTEX_WAIT. I just committed a change to s390 and ppc to make use of FUTEX_WAIT_BITSET if it is available (linux 2.6.29 onwards): http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=8f861542dd0603bef99e126e509ece89514c1eeb I did not make this change for other architectures since I did not have access to a test machine to verify the change. So I request the arch maintainers to implement the macro lll_futex_timed_wait_bitset in the manner similar to that in the patch above so that the rest of the code can then take advantage of the performance improvement due to FUTEX_WAIT_BITSET for their architecture. Currently, if lll_futex_timed_wait_bitset is not defined, the code simply selects lll_futex_timed_wait instead, which is the old behaviour. Thanks, Siddhesh