From: "Jan Beulich" Subject: Re: mixture of atomic and non-atomic operations on CPU masks Date: Wed, 10 Sep 2014 11:13:12 +0100 Message-ID: <5410405802000078000332C3@mail.emea.novell.com> References: <54100FCC0200007800033118@mail.emea.novell.com> <1410343392.8217.285.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XReto-0003NN-4V for xen-devel@lists.xenproject.org; Wed, 10 Sep 2014 10:13:16 +0000 In-Reply-To: <1410343392.8217.285.camel@kazak.uk.xensource.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: xen-devel , Keir Fraser , Ian Jackson , Tim Deegan List-Id: xen-devel@lists.xenproject.org >>> On 10.09.14 at 12:03, wrote: > On Wed, 2014-09-10 at 07:46 +0100, Jan Beulich wrote: >> the inconsistency here has been puzzling me for a while, and I think >> we ought to do something about it (perhaps not for 4.5 anymore, >> but then right after): cpumask_(test_and_)?(set|clear)_cpu all use >> the respective atomic bitops, in contrast to all other operations on >> cpumask_t. > > Did that just happen by accident because the bitops are sync by default > with a non-sync variant? I'm afraid not - in some cases the 1-bit manipulation functions are indeed expected to be usable in racy situations. I.e. I think Linux (from where we got all this) has this deliberately this way, not paying attention to the inconsistency and the often pointless extra overhead. Jan