From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 41062 invoked by alias); 25 Dec 2017 12:57:16 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 41040 invoked by uid 89); 25 Dec 2017 12:57:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=decreasing, HContent-Transfer-Encoding:8bit X-HELO: mail-qk0-f175.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=f7i+UeSyvMMd2PSw/SCjyVb9F9bS0iV0dB6CeykW4M0=; b=jdgMGpk29xKMKO2fhYpKzVHowJ9k00fKINerjxZTOfuCbVPUaAAhpW7lyq85wQwtbh b3N3F1ph7iRUgwfV8SJq+s97z+PkZUHWIgtDWqtGScN4gl7MNh7M5Ha75yWkVEcqO6FP KMwGfoQrWLb8XZjDa07TQYvxNM6u83Yka3mephB6CR6la/ZujWLkDWgO0gsCXTwCFQO0 dK/RuverWM+CyJ9Re/RluTxXHP0Eidvt0nMLLL0p1okptPliHU/z+gfKKN1Mv5U+Lejf zuYot3OxdiY+yNstkY4shS/WJ8kjbyCoBbpEXcJttc3FquJmu8FOdu1sgXyDwQIf0TAb FRxg== X-Gm-Message-State: AKGB3mJdKDlXfnx3TCZB1H+8B3ntOdPDV+SnK76cs82tafU9HG4iGd1S a1m4lgWydj1kdxtdnQvoreooAgOEk2c= X-Google-Smtp-Source: ACJfBouWQmbnR1NPx6TJlmNkZU+vAgBqSgyt5nkzAQAeGzBCvcs1ylIpCDAJ7MY+iN25AlduQg2jPA== X-Received: by 10.55.215.217 with SMTP id t86mr27491794qkt.288.1514206632418; Mon, 25 Dec 2017 04:57:12 -0800 (PST) Subject: Re: RISC-V glibc port v2 To: libc-alpha@sourceware.org References: From: Adhemerval Zanella Message-ID: Date: Mon, 25 Dec 2017 12:57:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2017-12/txt/msg00886.txt.bz2 On 20/12/2017 19:45, Palmer Dabbelt wrote: > On Wed, 20 Dec 2017 13:11:02 PST (-0800), joseph@codesourcery.com wrote: >> On Tue, 19 Dec 2017, Palmer Dabbelt wrote: >> >>> * Should we have padding in __pthread_rwlock_arch_t?  I assume the padding on >>>   other architectures is there for ABI reasons and shouldn't be necessary for >>>   new ports, but the ports I usually rely on all have excatly the same padding >>>   so I'm worried there's another reason for this. >> >> The size was probably originally chosen to be the same as used by >> Linuxthreads.  Since then, there's been at least one rwlock rewrite that >> increased the amount of space that's padding. >> >> On the whole I'd say it's safest to have that padding on RISC-V as well, >> in case there are any more rewrites in future, since it's possible a >> rewrite could increase the amount of space used as well as decreasing it, >> and so if one architecture makes the type smaller than others that could >> complicate any such future change needing more space. > > Sounds good.  I'll add a comment > > diff --git a/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h b/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h > index f15e024826ac..4fabc4a2cde2 100644 > --- a/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h > +++ b/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h > @@ -52,6 +52,10 @@ > #define __LOCK_ALIGNMENT > #define __ONCE_ALIGNMENT > > +/* There is a lot of padding in this structure.  While it's not strictly > +   necessary on RISC-V, we're going to leave it in to be on the safe side in > +   case it's needed in the future.  Most other architectures have the padding, > +   so this gives us the same extensibility as everyone else has.  */ > struct __pthread_rwlock_arch_t > { >   unsigned int __readers; I have a patchset that should reorganize better the pthread type internal structures and add default version that will make new ports easier (no need to redefine them unless the port requires something special). I am planning to send it for reviews today or tomorrow.