Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932596AbbGTPCq (ORCPT ); Mon, 20 Jul 2015 11:02:46 -0400 Received: from cantor2.suse.de ([195.135.220.15]:33572 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754213AbbGTPCp (ORCPT ); Mon, 20 Jul 2015 11:02:45 -0400 Date: Mon, 20 Jul 2015 17:02:40 +0200 From: Joerg Roedel To: Borislav Petkov Cc: Joerg Roedel , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/smpboot: Check for cpu_active on cpu initialization Message-ID: <20150720150240.GJ13082@suse.de> References: <1437038237-16741-1-git-send-email-joro@8bytes.org> <20150720144619.GA9361@nazgul.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150720144619.GA9361@nazgul.tnic> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1322 Lines: 36 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 -- 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/