Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5043709ybi; Tue, 11 Jun 2019 18:02:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnwOKB7C2lkQ9VvswOIaCnwqpQJy52e1e4+70c70+uiSBfnEg5bF99w6praTp2FvgXRl0A X-Received: by 2002:a63:454a:: with SMTP id u10mr21133294pgk.291.1560301369380; Tue, 11 Jun 2019 18:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560301369; cv=none; d=google.com; s=arc-20160816; b=t5AU29vvdw0icDg1n7c1TmVJFN72G5R45bU7WIoNR+zIhb3lvLmCFBc7HndSwJUTAk X22srSKZiIwENEkui0XKrEnDR7VebckDSY+VVLs+vbgJauri/pmvC+si+qxDqTX0I9Pn RqVTXl1oA1IHPNYfy66u/gDak7KDKTYgC6YflK6JODz77Vj3DMm4zTYfb1/nfipGTdJ5 XbjsLXnpcFpIeUUb8Gky01z/bPRo5+kIz37r1aJUZTanZYrSAA7f/SHT3t1Jn2ZGDNBB vk345z1KytiEpJ/Npu7sGvdponcfYBuPq6TC+F78Qnll3YB/8UMTK/Ef6O4YPuv3P2VE o9Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Udbs7ULc2Me0DEcSN4XsHz4GmDjnXfH+c1AaDMA+QjA=; b=hwwioQhKh8Y5jRW9uEyb/UClC1fGwW2LmG4HFzj94QyXtw2i11ifCDHXGLRgjdwGim WlY1oNfw8xI2mZPQfTlHzAD46aZOgdg6eyjNaFFckUXRdfioncDqeI9WicKfzWaFbYhZ 67taLUOlqsMsGMwRiod22LyW4DeMMX+Y9tBFioozyPCLYREVxPTGrsJjhV8mcmNdgs+O SMshLXTsvkBoIQj2rhlQuDKYt0OoclDP0HWX8huHqgB4xc90j6eC+wGvDwi+3IPazU7A cnttqdEe/cHbYu1c+9/UtisVG4zA8VwCRlopnvdIXQRErUOjC1fMBwgEpVR3+AKz7hd3 /1ag== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10si15786239pfj.93.2019.06.11.18.02.32; Tue, 11 Jun 2019 18:02:49 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406403AbfFKUjv (ORCPT + 99 others); Tue, 11 Jun 2019 16:39:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33776 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406156AbfFKUjv (ORCPT ); Tue, 11 Jun 2019 16:39:51 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2FE74883BA; Tue, 11 Jun 2019 20:39:51 +0000 (UTC) Received: from amt.cnet (ovpn-112-4.gru2.redhat.com [10.97.112.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id DCDC91972D; Tue, 11 Jun 2019 20:39:50 +0000 (UTC) Received: from amt.cnet (localhost [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 43525105163; Tue, 11 Jun 2019 17:39:27 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.7/8.14.7/Submit) id x5BKdNTN013899; Tue, 11 Jun 2019 17:39:23 -0300 Date: Tue, 11 Jun 2019 17:39:22 -0300 From: Marcelo Tosatti To: Wanpeng Li Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH v3 1/4] KVM: LAPIC: Make lapic timer unpinned when timer is injected by pi Message-ID: <20190611203919.GB7520@amt.cnet> References: <1560255429-7105-1-git-send-email-wanpengli@tencent.com> <1560255429-7105-2-git-send-email-wanpengli@tencent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1560255429-7105-2-git-send-email-wanpengli@tencent.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 11 Jun 2019 20:39:51 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 11, 2019 at 08:17:06PM +0800, Wanpeng Li wrote: > From: Wanpeng Li > > Make lapic timer unpinned when timer is injected by posted-interrupt, > the emulated timer can be offload to the housekeeping cpus. > > The host admin should fine tuned, e.g. dedicated instances scenario > w/ nohz_full cover the pCPUs which vCPUs resident, several pCPUs > surplus for housekeeping, disable mwait/hlt/pause vmexits to occupy > the pCPUs, fortunately preemption timer is disabled after mwait is > exposed to guest which makes emulated timer offload can be possible. Li, Nice! I think you can drop the HRTIMER_MODE_ABS_PINNED and instead have void kvm_set_pending_timer(struct kvm_vcpu *vcpu) { kvm_make_request(KVM_REQ_PENDING_TIMER, vcpu); kvm_vcpu_kick(vcpu); } As an alternative to commit 61abdbe0bcc2b32745ab4479cc550f4c1f518ee2 (as a first patch in your series). This will make the logic simpler (and timer migration, for nonhousekeeping case, ensures timer is migrated). Also, should make this work for non housekeeping case as well. (But that can be done later). Thanks.