From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18814 invoked by alias); 19 Feb 2013 16:42:13 -0000 Received: (qmail 18604 invoked by uid 22791); 19 Feb 2013 16:42:09 -0000 X-SWARE-Spam-Status: No, hits=-5.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-qa0-f49.google.com (HELO mail-qa0-f49.google.com) (209.85.216.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Feb 2013 16:42:02 +0000 Received: by mail-qa0-f49.google.com with SMTP id o13so1923583qaj.15 for ; Tue, 19 Feb 2013 08:42:01 -0800 (PST) X-Received: by 10.224.30.203 with SMTP id v11mr7987311qac.31.1361292121786; Tue, 19 Feb 2013 08:42:01 -0800 (PST) Received: from pebble.twiddle.net (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by mx.google.com with ESMTPS id no8sm15146249qeb.0.2013.02.19.08.41.59 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 19 Feb 2013 08:42:00 -0800 (PST) Message-ID: <5123AB55.2070100@twiddle.net> Date: Tue, 19 Feb 2013 16:42:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Siddhesh Poyarekar CC: libc-ports@sourceware.org, libc-alpha@sourceware.org Subject: Re: PI mutex support for pthread_cond_* now in nptl References: <20130218105637.GJ32163@spoyarek.pnq.redhat.com> In-Reply-To: <20130218105637.GJ32163@spoyarek.pnq.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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: 2013-02/txt/msg00039.txt.bz2 On 2013-02-18 02:56, Siddhesh Poyarekar wrote: > Hi arch-maintainers! > > The x86 assembly code for pthread_cond_* functions has, since some > time now, been capable of utilizing PI mutexes (using > PTHREAD_PRIO_INHERIT when initializing a mutex) optimally by using the > FUTEX_WAIT_REQUEUE_PI and its companion FUTEX_CMP_REQUEUE_PI to > requeue waiters woken on pthread_cond_broadcast to the PI mutex while > waking just one child, hence avoiding the thundering herd effect. > This code is now available on the default C implementation in master, > which is used by most non-x86 architectures in glibc. > > To allow your architecture to use this, you need to define the > following: > > - lll_futex_wait_requeue_pi macro to call the FUTEX_WAIT_REQUEUE_PI > operation in a futex syscall. > > - lll_futex_timed_wait_requeue_pi, which is the timed equivalent of > the above. > > - lll_futex_cmp_requeue_pi to call FUTEX_CMP_REQUEUE_PI. > > I have committed implementations for s390 and powerpc, which can be > used as examples for implementation on other architectures. Any chance we can move these macros into a generic linux header? Given that we're using INTERNAL_SYSCALL macros, the definitions ought to be the same for all targets. r~