Message ID | 20140317135545.GM1850@spoyarek.pnq.redhat.com |
---|---|
State | Committed |
Headers |
Return-Path: <x14307373@homiemail-mx20.g.dreamhost.com> X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx20.g.dreamhost.com (caibbdcaaahc.dreamhost.com [208.113.200.72]) by wilcox.dreamhost.com (Postfix) with ESMTP id 198263600B0 for <siddhesh@wilcox.dreamhost.com>; Mon, 17 Mar 2014 06:55:16 -0700 (PDT) Received: by homiemail-mx20.g.dreamhost.com (Postfix, from userid 14307373) id CF6234088B8A1; Mon, 17 Mar 2014 06:55:15 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx20.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx20.g.dreamhost.com (Postfix) with ESMTPS id B0D7F40672512 for <glibc@patchwork.siddhesh.in>; Mon, 17 Mar 2014 06:55:15 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=hUR9H5dDXxBl0xS/C7GRPZl1jQ69r RiX4xZsdMqdyDE3TBIoMG8iPkTzZisyJo519Dt6Pre3LZHLjIcTpuQ7Vmntk8593 A/u1wAonV1r3NKLoTiu7RxK9BciXsRNOrBAx9d8SJdMeus/Evg5VPlp7GZ+sH+D2 U5G2qGLlxm1xvU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=nQ6/Vl2hSqJ9SJ8HSCPySdEJrNU=; b=yEe Aftv/y4IVx7vdBhw06butsVZELu4noTcMxxM9YSwK0fT82j5I9gvNlFfo33QarpI je6VmJAJjAAsw5UiGfXRE4CS/PmZ+ZvO1FB+tvFeK0B8Ow2oy2rzLDnE0ZEvBx4p BXhqxbiVYNkNHe5Ya5Ius+MIktdp0hZk+fI71r7k= Received: (qmail 30358 invoked by alias); 17 Mar 2014 13:55:13 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-glibc=patchwork.siddhesh.in@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 30349 invoked by uid 89); 17 Mar 2014 13:55:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Date: Mon, 17 Mar 2014 19:25:45 +0530 From: Siddhesh Poyarekar <siddhesh@redhat.com> To: libc-alpha@sourceware.org Subject: [PATCH] Get rid of __LT_SPINLOCK_INIT Message-ID: <20140317135545.GM1850@spoyarek.pnq.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Zvl510+jvRFHh8wJ" Content-Disposition: inline User-Agent: Mutt/1.5.22.1-rc1 (2013-10-16) X-DH-Original-To: glibc@patchwork.siddhesh.in |
Commit Message
Siddhesh Poyarekar
March 17, 2014, 1:55 p.m. UTC
Hi, We got rid of LinuxThreads in 2005, but we didn't remove __LT_SPINLOCK_INIT back then. Do it now. Siddhesh * nptl/sysdeps/pthread/bits/libc-lockP.h [defined NOT_IN_libc && !defined IS_IN_libpthread && __LT_SPINNOCK_INIT != 0]: Remove.
Comments
On 17-03-2014 10:55, Siddhesh Poyarekar wrote: > Hi, > > We got rid of LinuxThreads in 2005, but we didn't remove > __LT_SPINLOCK_INIT back then. Do it now. > > Siddhesh > > * nptl/sysdeps/pthread/bits/libc-lockP.h [defined NOT_IN_libc > && !defined IS_IN_libpthread && __LT_SPINNOCK_INIT != 0]: > Remove. > > diff --git a/nptl/sysdeps/pthread/bits/libc-lockP.h b/nptl/sysdeps/pthread/bits/libc-lockP.h > index bacc678..ec20271 100644 > --- a/nptl/sysdeps/pthread/bits/libc-lockP.h > +++ b/nptl/sysdeps/pthread/bits/libc-lockP.h > @@ -78,13 +78,8 @@ typedef pthread_key_t __libc_key_t; > CLASS __libc_lock_t NAME = LLL_LOCK_INITIALIZER; > # endif > #else > -# if __LT_SPINLOCK_INIT == 0 > -# define __libc_lock_define_initialized(CLASS,NAME) \ > +# define __libc_lock_define_initialized(CLASS,NAME) \ > CLASS __libc_lock_t NAME; > -# else > -# define __libc_lock_define_initialized(CLASS,NAME) \ > - CLASS __libc_lock_t NAME = PTHREAD_MUTEX_INITIALIZER; > -# endif > #endif > > #define __libc_rwlock_define_initialized(CLASS,NAME) \ I'm ok with this patch (In fact I was about to send this patch too).
On 17 March 2014 13:55, Siddhesh Poyarekar <siddhesh@redhat.com> wrote: Hi Siddesh, > We got rid of LinuxThreads in 2005, but we didn't remove > __LT_SPINLOCK_INIT back then. Do it now. This looks straightforward, however it seems the only arch that ever set __LT_SPINLOCK_INIT was hppa, so I assume this conditional was meant once upon a time to do something for hppa. I guess the patch is fine (as it does not change existing behaviour) but maybe someone who cares about hppa should verify that something isn't needed for that arch here.
On 17-03-2014 12:18, Will Newton wrote: > On 17 March 2014 13:55, Siddhesh Poyarekar <siddhesh@redhat.com> wrote: > > Hi Siddesh, > >> We got rid of LinuxThreads in 2005, but we didn't remove >> __LT_SPINLOCK_INIT back then. Do it now. > This looks straightforward, however it seems the only arch that ever > set __LT_SPINLOCK_INIT was hppa, so I assume this conditional was > meant once upon a time to do something for hppa. I guess the patch is > fine (as it does not change existing behaviour) but maybe someone who > cares about hppa should verify that something isn't needed for that > arch here. > Carlos O'Donnel is the maintainer for hppa. However, if you ever check on GLIBC (a simple grep), you will see __LT_SPINLOCK_INIT is never defined in any arch config file and it was only defined by when glibc used linuxpthread. So I think it safe to just get rid of it.
On Mon, Mar 17, 2014 at 12:31:18PM -0300, Adhemerval Zanella wrote: > Carlos O'Donnel is the maintainer for hppa. However, if you ever check on > GLIBC (a simple grep), you will see __LT_SPINLOCK_INIT is never defined in > any arch config file and it was only defined by when glibc used linuxpthread. > So I think it safe to just get rid of it. That's what I did, in addition to trying to figure out when it got added in, which led me to the hppa bits too. Siddhesh
On 03/17/2014 11:39 AM, Siddhesh Poyarekar wrote: > On Mon, Mar 17, 2014 at 12:31:18PM -0300, Adhemerval Zanella wrote: >> Carlos O'Donnel is the maintainer for hppa. However, if you ever check on >> GLIBC (a simple grep), you will see __LT_SPINLOCK_INIT is never defined in >> any arch config file and it was only defined by when glibc used linuxpthread. >> So I think it safe to just get rid of it. > > That's what I did, in addition to trying to figure out when it got > added in, which led me to the hppa bits too. The hppa port no longer needs __LT_SPINLOCK_INIT. As of NPTL we switched to zero-initialized locks to avoid the terrible headache of teaching developers that calloc() is not the right way to initialize a mutex, despite it working on x86*. We used to have one-initialized locks because hppa's only atomic operation is load-and-clear-word, and because of that we had our own special initialization in LinuxThreads. Cheers, Carlos.
diff --git a/nptl/sysdeps/pthread/bits/libc-lockP.h b/nptl/sysdeps/pthread/bits/libc-lockP.h index bacc678..ec20271 100644 --- a/nptl/sysdeps/pthread/bits/libc-lockP.h +++ b/nptl/sysdeps/pthread/bits/libc-lockP.h @@ -78,13 +78,8 @@ typedef pthread_key_t __libc_key_t; CLASS __libc_lock_t NAME = LLL_LOCK_INITIALIZER; # endif #else -# if __LT_SPINLOCK_INIT == 0 -# define __libc_lock_define_initialized(CLASS,NAME) \ +# define __libc_lock_define_initialized(CLASS,NAME) \ CLASS __libc_lock_t NAME; -# else -# define __libc_lock_define_initialized(CLASS,NAME) \ - CLASS __libc_lock_t NAME = PTHREAD_MUTEX_INITIALIZER; -# endif #endif #define __libc_rwlock_define_initialized(CLASS,NAME) \