From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113818 invoked by alias); 3 Nov 2016 15:39:28 -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 113795 invoked by uid 89); 3 Nov 2016 15:39:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=chip, Hx-languages-length:2179 X-HELO: mx1.redhat.com Message-ID: <1478187561.7146.742.camel@localhost.localdomain> Subject: Re: [RFC][PATCH 0/2] Make sparcv8 work again on cas enabled hardware From: Torvald Riegel To: David Miller Cc: andreas@gaisler.com, libc-alpha@sourceware.org, adhemerval.zanella@linaro.org, carlos@redhat.com, software@gaisler.com Date: Thu, 03 Nov 2016 15:39:00 -0000 In-Reply-To: <20161102.225245.471656475226254205.davem@davemloft.net> References: <1478081121.7146.673.camel@localhost.localdomain> <20161102.113238.241484722789762790.davem@davemloft.net> <1478125983.7146.733.camel@localhost.localdomain> <20161102.225245.471656475226254205.davem@davemloft.net> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-11/txt/msg00103.txt.bz2 On Wed, 2016-11-02 at 22:52 -0400, David Miller wrote: > From: Torvald Riegel > Date: Wed, 02 Nov 2016 23:33:03 +0100 > > > On Wed, 2016-11-02 at 11:32 -0400, David Miller wrote: > >> From: Torvald Riegel > >> > Or do you intend to write sparc-specific versions of all the concurrent > >> > data structures that are process-shared? > >> > >> This would be necessary anyways, if we have two modes. One that does > >> the pure-userland code path and one that does the kernel helper code > >> path. > > > > All the other archs that use a kernel helper for CAS don't need it. If > > you can call the helper in the atomic operations, you won't need a new > > algorithm except if you wanted to optimize the generic one. > > > >> Furthermore, sparc specific versions are needed in any case since we > >> have the v9 detection even in the v8 libraries. Look at all of the > >> code that checks for v9 in the dl_hwcap mask when deciding which > >> atomic operation to use. > > > > Or are you talking about the implementation of the atomic operations? > > Just as the "are we running on a v9 chip" test is a run-time one, Is there any difference between the additional CAS on a v8 and the CAS on a v9? If there should be none (eg, same instruciton encoding etc.), we wouldn't need a runtime check for this, would we? > whether we are running on a kernel with kernel CAS simulation support > will be run time code path check as well. That depends on whether we want to support sparc HW that does have a CAS. It's still not clear to me whether this is a goal, and if it's a goal, whether it's a goal for today or for some time in the future. > This is why we'll need sparc specific versions of the primitives, Which primitives are you talking about? The atomic operations in atomic-machine.h / atomic.h, or the synchronization primitives in nptl/? > and > why it would have been the more optimal if the primitives were > abstracted to the point where we didn't have to duplicate so much > stuff privately just to pull this off. I can't follow. What do you mean precisely?