All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: Ian Campbell <Ian.Campbell@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Keir Fraser <keir@xen.org>, Tim Deegan <tim@xen.org>
Subject: Re: mixture of atomic and non-atomic operations on CPU masks
Date: Wed, 10 Sep 2014 11:10:18 +0100	[thread overview]
Message-ID: <5410238A.6000200@citrix.com> (raw)
In-Reply-To: <54100FCC0200007800033118@mail.emea.novell.com>

On 10/09/14 07:46, Jan Beulich wrote:
> All,
>
> 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. A good part of the users don't require the atomicity at
> all (in particular any of those acting on function scope variables).
> Does anyone know of reasons why the default shouldn't be non-
> atomic ops across the board, with atomic special cases being made
> available for the few cases where they're actually needed?

Its entirely possible that the first users of test_and_? required
atomicity, and the first users which didn't require atomicity copied the
atomic ops as they already existed.

Defaulting to non-atomic seems reasonable, as I suspect that there are
fairly few cases where atomicity is required.  (At least atomic
operations on the local stack is not especially bad to other cpus; I
really hope other cpus don't have writable cache lines of our stack.)

~Andrew

      parent reply	other threads:[~2014-09-10 10:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-10  6:46 mixture of atomic and non-atomic operations on CPU masks Jan Beulich
2014-09-10 10:03 ` Ian Campbell
2014-09-10 10:13   ` Jan Beulich
2014-09-10 10:10 ` Andrew Cooper [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5410238A.6000200@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Ian.Campbell@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.