All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <jroedel@suse.de>
To: Borislav Petkov <bp@alien8.de>
Cc: Joerg Roedel <joro@8bytes.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/smpboot: Check for cpu_active on cpu initialization
Date: Mon, 20 Jul 2015 17:02:40 +0200	[thread overview]
Message-ID: <20150720150240.GJ13082@suse.de> (raw)
In-Reply-To: <20150720144619.GA9361@nazgul.tnic>

On Mon, Jul 20, 2015 at 04:46:19PM +0200, Borislav Petkov wrote:
> On Thu, Jul 16, 2015 at 11:17:17AM +0200, Joerg Roedel wrote:
> > The reason is that the cpu_active bit for the new CPU
> > becomes visible significantly later than the cpu_online bit.
> 
> I see
> 
> void set_cpu_online(unsigned int cpu, bool online)
> {
> 	if (online) {
> 		cpumask_set_cpu(cpu, to_cpumask(cpu_online_bits));
> 		cpumask_set_cpu(cpu, to_cpumask(cpu_active_bits));
> 	} else {
> 
> which is called in start_secondary().
> 
> Do you mean that setting the bit in cpu_active_mask gets delayed soo
> much? Because it comes right after setting the bit in cpu_online_mask.

Yes, cpu_active becomes either set a lot later in a KVM guest, when the
host decides to preempt the vCPU right after setting cpu_online, but
before cpu_active is set, or on bare-metal.

I have seen a report where this happens on bare metal, when the change
to the cpu_active bit becomes visible on the other CPU significantly
later than the the cpu_online bit. This happened on a pretty big machine
with 88 cores.


	Joerg


  reply	other threads:[~2015-07-20 15:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-16  9:17 [PATCH] x86/smpboot: Check for cpu_active on cpu initialization Joerg Roedel
2015-07-20 14:46 ` Borislav Petkov
2015-07-20 15:02   ` Joerg Roedel [this message]
2015-07-20 15:10     ` Borislav Petkov
2015-07-20 15:18       ` Joerg Roedel
2015-07-20 15:27         ` Borislav Petkov
2015-07-27 18:21           ` [PATCH] sched: fix cpu_active_mask/cpu_online_mask race Jan H. Schönherr
2015-07-30 16:00             ` Peter Zijlstra
2015-07-30 19:17               ` [PATCH v2] " Jan H. Schönherr

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=20150720150240.GJ13082@suse.de \
    --to=jroedel@suse.de \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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.