From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18234 invoked by alias); 15 Aug 2012 17:05:11 -0000 Received: (qmail 18192 invoked by uid 22791); 15 Aug 2012 17:05:10 -0000 X-SWARE-Spam-Status: No, hits=-7.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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; Wed, 15 Aug 2012 17:04:49 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7FH4Ik6028200 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 15 Aug 2012 13:04:23 -0400 Received: from stumpy.slc.redhat.com (ovpn-113-80.phx2.redhat.com [10.3.113.80]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q7FH4GHX022702; Wed, 15 Aug 2012 13:04:17 -0400 Message-ID: <502BD690.50501@redhat.com> Date: Wed, 15 Aug 2012 17:05:00 -0000 From: Jeff Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Maxim Kuvyrkov CC: Roland McGrath , Andrew Haley , David Miller , "Joseph S. Myers" , Richard Sandiford , libc-ports@sourceware.org, GLIBC Devel , Chris Metcalf Subject: Re: [PATCH] Unify pthread_spin_[try]lock implementations. References: <65B470D2-4D01-4BA1-AEC5-A72C0006EA22@codesourcery.com> <20120711081441.73BB22C093@topped-with-meat.com> <20120711.012509.1325789838255235021.davem@davemloft.net> <4FFD3CD9.4030206@redhat.com> <84304C03-6A49-4263-9016-05486EDC0E98@codesourcery.com> <4FFD4114.9000806@redhat.com> <20120711112235.B28CA2C099@topped-with-meat.com> <7FBB4F87-9FF3-4239-818F-5A38C8094011@codesourcery.com> <20120725181300.DD1812C0B5@topped-with-meat.com> <36A2FFD8-0C98-4AB6-8C64-2EEC5CC67A63@codesourcery.com> <20120815162637.B74982C0F2@topped-with-meat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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-08/txt/msg00136.txt.bz2 On 08/15/2012 10:39 AM, Maxim Kuvyrkov wrote: >> >>> +#define SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000 >>> +#include_next I haven't followed this discussion closely,so if I'm bringing up an issue which you're already dealing with or have plans to deal with, my apologies. I'm aware these constants can vary on a per-architecture basis; however, is any provision made for varying them within a particular architecture. The reason I ask is once of Red Hat's partners raised an issue around adaptive mutexes where the upper bound for the spin count was less than a cache round trip on that partner's modern processors. It seems to me that SPIN_LOCK_READS_BETWEEN_CMPXCHG may have the property that varying it at runtime based on the characteristics of the particular chip running the application might be worthwhile. And, yes, there are some vague plans for Red Hat to write and submit code for the adaptive mutex issue :-) jeff