From patchwork Thu Jun 19 22:27:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1581 Received: (qmail 5714 invoked by alias); 19 Jun 2014 22:27:47 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 5703 invoked by uid 89); 19 Jun 2014 22:27:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPAM_URI1, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-ob0-f169.google.com MIME-Version: 1.0 X-Received: by 10.60.155.33 with SMTP id vt1mr7537197oeb.3.1403216864479; Thu, 19 Jun 2014 15:27:44 -0700 (PDT) In-Reply-To: <20140619205240.GY8178@tassilo.jf.intel.com> References: <1399412209-28245-1-git-send-email-andi@firstfloor.org> <1399412209-28245-4-git-send-email-andi@firstfloor.org> <20140619205240.GY8178@tassilo.jf.intel.com> Date: Thu, 19 Jun 2014 15:27:44 -0700 Message-ID: Subject: Re: [PATCH 3/3] Add adaptive elision to rwlocks v2 From: "H.J. Lu" To: Andi Kleen Cc: Andi Kleen , GNU C Library On Thu, Jun 19, 2014 at 1:52 PM, Andi Kleen wrote: >> This is wrong for x32. We need something like > > Ok. Looks good to me. I assume you'll handle it. > > -Andi > >> >> diff --git a/sysdeps/x86/nptl/bits/pthreadtypes.h >> b/sysdeps/x86/nptl/bits/pthreadtypes.h >> index b04c32b..bfb9034 100644 >> --- a/sysdeps/x86/nptl/bits/pthreadtypes.h >> +++ b/sysdeps/x86/nptl/bits/pthreadtypes.h >> @@ -185,12 +185,17 @@ typedef union >> int __writer; >> int __shared; >> signed char __rwelision; >> +# ifdef __ILP32__ >> + unsigned char __pad1[3]; >> +# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, {0, 0, 0 } >> +# else >> unsigned char __pad1[7]; >> +# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, {0, 0, 0, 0, 0, 0, 0 } >> +# endif >> unsigned long int __pad2; >> /* FLAGS must stay at this position in the structure to maintain >> binary compatibility. */ >> unsigned int __flags; >> -# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, {0, 0, 0, 0, 0, 0, 0 } >> # define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1 >> } __data; >> # else >> >> >> H.J. > I am checking in this. Thanks. diff --git a/ChangeLog b/ChangeLog index 841d55e..ec08f77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-06-19 H.J. Lu + + * sysdeps/x86/nptl/bits/pthreadtypes.h (pthread_rwlock_t): Use + 3 bytes for __pad1 for x32. + (__PTHREAD_RWLOCK_ELISION_EXTRA): Likewise. + 2014-06-19 Ling Ma H.J. Lu diff --git a/sysdeps/x86/nptl/bits/pthreadtypes.h b/sysdeps/x86/nptl/bits/pthreadtypes.h index b04c32b..7f8076b 100644 --- a/sysdeps/x86/nptl/bits/pthreadtypes.h +++ b/sysdeps/x86/nptl/bits/pthreadtypes.h @@ -185,12 +185,17 @@ typedef union int __writer; int __shared; signed char __rwelision; +# ifdef __ILP32__ + unsigned char __pad1[3]; +# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0 } +# else unsigned char __pad1[7]; +# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0, 0, 0, 0, 0 } +# endif unsigned long int __pad2; /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned int __flags; -# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, {0, 0, 0, 0, 0, 0, 0 } # define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1 } __data; # else