Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932148Ab2HPNAm (ORCPT ); Thu, 16 Aug 2012 09:00:42 -0400 Received: from moutng.kundenserver.de ([212.227.17.9]:52947 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755369Ab2HPNAj (ORCPT ); Thu, 16 Aug 2012 09:00:39 -0400 From: Arnd Bergmann To: Will Deacon Subject: Re: [PATCH v2 26/31] arm64: Miscellaneous library functions Date: Thu, 16 Aug 2012 13:00:32 +0000 User-Agent: KMail/1.12.2 (Linux/3.5.0; KDE/4.3.2; x86_64; ; ) Cc: Catalin Marinas , "linux-arch@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Marc Zyngier References: <1344966752-16102-1-git-send-email-catalin.marinas@arm.com> <201208151521.14663.arnd@arndb.de> <20120816105709.GK31784@mudshark.cambridge.arm.com> In-Reply-To: <20120816105709.GK31784@mudshark.cambridge.arm.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201208161300.32830.arnd@arndb.de> X-Provags-ID: V02:K0:RhwUSoSH6n1x6qaIYo/MGjb9Ae6IcjthNOIkOOa02+Q MJX937b34+KEmvHMaiDdsgD7+rr9hLgYV+1zkA4nFjKHoU2KjV MGtQFzb5SMyNUVv7rztf5+NsQNy8QUaO6aj+f9xJrY3NiSqSKY G1X9pt1Q7R9XWLAyd5/u/uGQZ/1uo+dqDmRw6lERtRfDslx4pG UzS9lgqMbNBhsJmMeSc/O0lykoylJQY9rCJZ+imiknEpK4+iec 1TZkRndecGf4uzV01b+vGSAgnWfvKZhF2I+blAbudGUpgZImdj LagTBZ829PaKzCQ1/qRKy4NYQQDFyh2E91FT9iPK4HcurlESYM wt/tjnjb6uGBTNJzFOLM= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1553 Lines: 42 On Thursday 16 August 2012, Will Deacon wrote: > > > + > > > +#include > > > +#include > > > +#include > > > + > > > +#ifdef CONFIG_SMP > > > +arch_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned = { > > > + [0 ... (ATOMIC_HASH_SIZE-1)] = __ARCH_SPIN_LOCK_UNLOCKED > > > +}; > > > +#endif > > > > What? > > > > I suppose this is a leftover from an earlier version using the > > generic bitops, right? > > We currently use the generic atomic bitops (asm-generic/bitops/atomic.h) > which contains: > > # define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) a)/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ])) > > so we have to provide a definition for the array. We have additional patches > containing optimised assembly implementations of the atomic bitops which we > will push later, once we've got some hardware to benchmark with. > Ah, I was confusing this with the asm/atomic.h stuff, for which you already provide an optimized version. The generic atomic bitops are really horrible in performance and I would expect that there is just one obvious way to implement bitops using ldaxr/stlxr, so I recommend just doing that even if you have no hardware for benchmarking. The s390 version should be fairly easy to adapt. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/