All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: James Morse <james.morse@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: get_online_cpus() from a  preemptible() context (bug?)
Date: Mon, 6 Nov 2017 11:40:38 +0100	[thread overview]
Message-ID: <20171106104038.GD3857@worktop> (raw)
In-Reply-To: <20171106103212.GG3165@worktop.lehotels.local>

On Mon, Nov 06, 2017 at 11:32:12AM +0100, Peter Zijlstra wrote:
> On Fri, Nov 03, 2017 at 02:45:45PM +0000, James Morse wrote:
> > Hi Thomas, Peter,
> > 
> > I'm trying to work out what stops a thread being pre-empted and migrated between
> > calling get_online_cpus() and put_online_cpus().

Nothing; why would you think it would? All those functions guarantee is
that any CPU observed as being online says online (and its converse,
that a CPU observed as being offline, says offline, although less people
care about that one).

That is; it serializes against CPU hotplug, nothing else.

  reply	other threads:[~2017-11-06 10:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-03 14:45 get_online_cpus() from a preemptible() context (bug?) James Morse
2017-11-06 10:32 ` Peter Zijlstra
2017-11-06 10:40   ` Peter Zijlstra [this message]
2017-11-06 18:51   ` James Morse
2017-11-06 21:07     ` Peter Zijlstra
2017-11-08 16:07       ` James Morse

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=20171106104038.GD3857@worktop \
    --to=peterz@infradead.org \
    --cc=james.morse@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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.