From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([66.187.233.31]:49447 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937561AbWLFTnv (ORCPT ); Wed, 6 Dec 2006 14:43:51 -0500 From: David Howells In-Reply-To: <20061206192939.GX3013@parisc-linux.org> References: <20061206192939.GX3013@parisc-linux.org> <20061206164314.19870.33519.stgit@warthog.cambridge.redhat.com> <20061206190828.GE4587@ftp.linux.org.uk> Subject: Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it Date: Wed, 06 Dec 2006 19:43:15 +0000 Message-ID: <28576.1165434195@redhat.com> Sender: linux-arch-owner@vger.kernel.org To: Matthew Wilcox Cc: Linus Torvalds , 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 List-ID: Matthew Wilcox 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's not a problem for workqueues, since the only direct assignment to the management member variable is during initialisation. But in general cmpxchg() might be a problem with respect to assignment. atomic_cmpxchg() should be safe wrt atomic_set(). David