Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937565AbWLFTnx (ORCPT ); Wed, 6 Dec 2006 14:43:53 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S937564AbWLFTnx (ORCPT ); Wed, 6 Dec 2006 14:43:53 -0500 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> 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 Subject: Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it X-Mailer: MH-E 8.0; nmh 1.1; GNU Emacs 22.0.50 Date: Wed, 06 Dec 2006 19:43:15 +0000 Message-ID: <28576.1165434195@redhat.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 795 Lines: 21 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 - 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/