Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5329185ybi; Wed, 12 Jun 2019 00:19:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLUkzl7v068tNRkSQSNQ0iUOXx25QfGjdCfCnEd8WURQk9+jC4rPj9LJcVqHn1xzANPQWU X-Received: by 2002:a17:902:54f:: with SMTP id 73mr78900173plf.246.1560323952700; Wed, 12 Jun 2019 00:19:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560323952; cv=none; d=google.com; s=arc-20160816; b=G7rKn7MORYMuSjK9DmZyvfziiod/v9wmdpMAS409+PcTyMTwtHjKZSb6Y9ElEJH7GW +yN0IqJzwvuCwFeMrISz6iYIgeOicuFW2zcfZdy1ERcnf/aKV1Yll6fosre8RqxOYqMr CmJgV6eUEvInKTxI9p481fSc5pGXKK1Ou6vrpfXn9EFw3Q4ZibiynjVTmuaV4fK+GRr4 ivkyIDl/58GDxrDbOSFAScd5KvFzWIax67nmhAOAw4AiWsd2iVv1ddi02UftFb425rnS /7S3+cxD1y48lHIBnHXJEbfDEcjfYG53qMMoHBAxg7Irvj6+z1yPUX+JBG4nQ2lxd3RI c7Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=rom31ac+oTIgk+nM7YCEF4uKjf6HAUZ2gRCm9n6eGlE=; b=nOO09ZO5YSoyk5kdcniHYXCZkgoShCjQGU/Fpu2KzT/hlyL/ZiczeCHCvMRVIXRwnL IBkNYmCOiv1JpD074viHXMS0DWBeUnU/9PYb3NIZfCsrkDSgD5nao2021e73dqTz5VYM NIm6RccOmwWvydyxWfrxKbYauwCspuFM8sDnd+Mv+gGlcwW+dPD45cTkaIE99ZuKhBp8 IMhOMm6YFWCr/zsjv1A3IMZQT2nIeSh6MDUXBS8H0t1k9Wbr4+Y1WViI2L9Fy358H2IB 7EwetnpLAJTlR1C6hBUi7BoRr8Qrgh7wA2v+vV5JBXW5r4+f2xLx/dPllBrOin7M76H4 uFkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RRm2KOro; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v38si15230577plg.277.2019.06.12.00.18.57; Wed, 12 Jun 2019 00:19:12 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RRm2KOro; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405582AbfFLAo1 (ORCPT + 99 others); Tue, 11 Jun 2019 20:44:27 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:38353 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405015AbfFLAo1 (ORCPT ); Tue, 11 Jun 2019 20:44:27 -0400 Received: by mail-ot1-f67.google.com with SMTP id d17so13770871oth.5; Tue, 11 Jun 2019 17:44:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rom31ac+oTIgk+nM7YCEF4uKjf6HAUZ2gRCm9n6eGlE=; b=RRm2KOrokA19xU1MyfdHQKveGTVmuPjyOyDOgBJ0901rg3gcSIUAcmwKrOI9N4Gsqz Ei5EK/eyaR6hwp/2V9DpGKAAWcQzNqJaKd+73ohRdtn8qe/sCseGGRK25Puvv8Ln+KlR C3pEf7YqRJMCgAfBY4ca4OcpMJhSISuwmKL010tvq1LfCoClSh7A7g2FPTW6/GZo4nxk TUied5oyVr/YWeZ0485ASZ7FDT2kb9BjmLgHE1JqY+59xn3++E4n9BtXZ5WWcYxhDoh1 OlJEix/bCHEAOn2TRTuxZaXHi8M+mWLXdcNhQKU54XwJrcEma1q1MnGd24oZ+Sf04tkh GzsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rom31ac+oTIgk+nM7YCEF4uKjf6HAUZ2gRCm9n6eGlE=; b=R5uNhtC4Z4kGtloerr/zJnk1+3lDfzfQIGHVMRNmIvWSHNv/L9ZQVF4cqN1PzzAjCB A56V3p69e5uz5yMhnTSajwa6x55ZCMSsFiay26yGW8Rzx90nh2XJRpBYcij2E9E56NUH fO49wKsYQcBclKdQErCOQq4XkfKItyCZNhLFQqPU1SXoTRbFPtKiypLDgXyF0oDp8ceF JLcrleu3Lx447pF4qXgS5MkMaoUZYP+Poo4zqOh0f8Ah8Ff4p2CNkHoe6v1CAk0Qube+ aGbgybsVrBTejKjckGRRjs3nbsIxm7vWBhLh0xuHiKgcEpkMJ6DFfFNG0WOEVXT3Yu2e Mwkg== X-Gm-Message-State: APjAAAU02vaJuPz+MjOsFK/0G3uTktbHKcn6IvWku26Ge3vd9QOftAA5 brcbSUudPWsbRvE4FVHYX7vmxOJuoN1niPZl2PQ6jg== X-Received: by 2002:a9d:2c47:: with SMTP id f65mr37530306otb.185.1560300266463; Tue, 11 Jun 2019 17:44:26 -0700 (PDT) MIME-Version: 1.0 References: <1560255429-7105-1-git-send-email-wanpengli@tencent.com> <1560255429-7105-2-git-send-email-wanpengli@tencent.com> <20190611203919.GB7520@amt.cnet> In-Reply-To: <20190611203919.GB7520@amt.cnet> From: Wanpeng Li Date: Wed, 12 Jun 2019 08:45:10 +0800 Message-ID: Subject: Re: [PATCH v3 1/4] KVM: LAPIC: Make lapic timer unpinned when timer is injected by pi To: Marcelo Tosatti Cc: LKML , kvm , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 12 Jun 2019 at 04:39, Marcelo Tosatti wrote: > > 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). Good point. :) > > Also, should make this work for non housekeeping case as well. > (But that can be done later). The timer fire may cause other vCPUs vmexits for non housekeeping case(after migrating timers fail during vCPU is scheduled to run in a different pCPU). Could you explain more? Regards, Wanpeng Li