Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937454AbWLFT3m (ORCPT ); Wed, 6 Dec 2006 14:29:42 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S937494AbWLFT3m (ORCPT ); Wed, 6 Dec 2006 14:29:42 -0500 Received: from palinux.external.hp.com ([192.25.206.14]:34668 "EHLO mail.parisc-linux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937462AbWLFT3k (ORCPT ); Wed, 6 Dec 2006 14:29:40 -0500 Date: Wed, 6 Dec 2006 12:29:39 -0700 From: Matthew Wilcox To: Linus Torvalds Cc: Al Viro , Christoph Lameter , Russell King , David Howells , Andrew Morton , linux-arm-kernel@lists.arm.linux.org.uk, Linux Kernel Mailing List , linux-arch@vger.kernel.org Subject: Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it Message-ID: <20061206192939.GX3013@parisc-linux.org> References: <20061206164314.19870.33519.stgit@warthog.cambridge.redhat.com> <20061206190828.GE4587@ftp.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1044 Lines: 21 On Wed, Dec 06, 2006 at 11:25:35AM -0800, Linus Torvalds wrote: > Ok. For SMP-safety, it's important that any architecture that can't do > this needs to _share_ the same spinlock (on SMP only, of course) that it > uses for the bitops. That doesn't help, since assignment can't be guarded by any lock. > It would be good (but perhaps not as strict a requirement) if the atomic > counters also use the same lock. But that is probably impossible on > sparc32 (since it has a per-counter "lock"-like thing, iirc). So doing a > cmpxchg() on an atomic_t would be a bug. sparc32 switched over to the parisc way of doing things, so they could expand their atomic_t to a full 32 bits. They still have the old atomic_24_t lying around for their arch-private use, but atomic_t uses a hashed spinlock. - 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/