Received: by 10.213.65.68 with SMTP id h4csp1689637imn; Thu, 15 Mar 2018 06:58:55 -0700 (PDT) X-Google-Smtp-Source: AG47ELuUostvnmcFBWsZybeXFnMtFtaHrffL/FfflrpQ6f/rLBPxL5Yuw53qQtSjT2Pvqfte7VAq X-Received: by 2002:a17:902:b185:: with SMTP id s5-v6mr8104485plr.109.1521122335656; Thu, 15 Mar 2018 06:58:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521122335; cv=none; d=google.com; s=arc-20160816; b=Dr3hJLuzx0CmYSWbjkQ0HYhF2oShBwhHbEu1f+rXA6EKpVod02aSFC0mVXAet9GUYu 8heLoiJ2sAC91OvTi42nAj1jPCP4Ccyg5feNboPl+TbTPKi4/Avotsb2KI50AdO2FsjK JYWyVEFuOWNiSy1rSh0gWOQy7bU+g5z/W+LH9b7+XPVNT66UYWdepuPGGc56Dr4Mil9u 9mZxE1VA4WMKrOQUzQ3+ssOuHuFpxF/dsQC0jgkOpl85q0GSPh0mb1iY5ZBhUlcW456+ 1GQbpEOifqQBLPoB3wgPZSMpd2wwoZzPVFqnYxgZHOshjewn9oPM2H6R0GgAhIR4qaF+ uWoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=Ow1fjjMf3QceyAsVGic8j1G0jLeJgwNJnp6Bc549ekg=; b=W0WVCG4gQZ/8vHF69luVrYBlqF/ga29xRKaRqNq5Io68qsdRO3pRb4bv+9hNExEi4b yODiWd4SHZdhq+rI/8iGhgK7d1lPcvk1iaFLiurKqc9i4UmVChx3N5WgsgMRX1+BofEq 1Ld1Jj/3peNk7QY/4K6sOHC7n/Kr8Oryc9/rKyxRWwjn4i9qvY9JpBBGSdBIH04b/O60 5vAFOs0eXcTVH4UtqgnFfipsAP/eNZbHY/BXl2iWQP6vwrrLNSCOK1CIu8GWtQfDUyc4 yvPsNMwSZEZLRPnE7O/XCVrC/StZ9mmPiJto0Og/k1HvMInpzLAqKcmDmN0YxN03cSRq 3Z9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12si3464059pgn.770.2018.03.15.06.58.40; Thu, 15 Mar 2018 06:58:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752205AbeCON5O (ORCPT + 99 others); Thu, 15 Mar 2018 09:57:14 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:53544 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752003AbeCON5N (ORCPT ); Thu, 15 Mar 2018 09:57:13 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1ewTNP-0008Tc-Q6; Thu, 15 Mar 2018 14:57:03 +0100 Date: Thu, 15 Mar 2018 14:57:03 +0100 (CET) From: Thomas Gleixner To: Peter Zijlstra cc: Vitaly Kuznetsov , kvm@vger.kernel.org, x86@kernel.org, Paolo Bonzini , =?ISO-8859-2?Q?Radim_Kr=E8m=E1=F8?= , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Mohammed Gamal , Cathy Avery , Bandan Das , LKML Subject: Re: [PATCH v3 4/7] x86/hyper-v: allocate and use Virtual Processor Assist Pages In-Reply-To: <20180315134848.GV4043@hirez.programming.kicks-ass.net> Message-ID: References: <20180309140249.2840-1-vkuznets@redhat.com> <20180309140249.2840-5-vkuznets@redhat.com> <87bmfpbqek.fsf@vitty.brq.redhat.com> <20180315134848.GV4043@hirez.programming.kicks-ass.net> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 15 Mar 2018, Peter Zijlstra wrote: > On Thu, Mar 15, 2018 at 12:45:03PM +0100, Thomas Gleixner wrote: > > On Thu, 15 Mar 2018, Vitaly Kuznetsov wrote: > > > The only user of these pages is currently KVM. Can we still have vCPUs > > > running on the outgoing CPU at this point? If case we can we're in > > > trouble and we need to somehow kick them out first. > > > > The first thing we do in unplug is to mark the CPU inactive, but I'm not > > sure whether that prevents something which was on the CPU before and > > perhaps preempted or is affine to that CPU to be scheduled in > > again. Peter???? > > I think we can still have tasks running at this point. > > AP_ACTIVE (sched_cpu_deactivate) simply takes the CPU out of the active > mask, which guarantees no new tasks will land on the CPU. > > We'll then proceed all the way to TEARDOWN_CPU as 'normal', at which > point we'll call stop_machine() which does the old DYING callbacks. > > It sounds like we want this done here, although possibly we can't do > vfree() from that context, in which case it needs to store the pointer > and do that from a BP callback (what used to be the OFFLINE callbacks or > something). So the wrmsr() wants to be in the dying range. The vfree() is questionable anyway because the re-onlining of that CPU will just allocate it again. So it could very well stay around. Thanks, tglx