Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6030343ybe; Tue, 10 Sep 2019 12:24:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDlEXumlztXQ/Ch2M2f+OjkcLvIb53VL7hxBfmoZkrsPeDL9zFc2apvtUQ3nN2/C556mCm X-Received: by 2002:a17:906:3293:: with SMTP id 19mr26278727ejw.265.1568143488937; Tue, 10 Sep 2019 12:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568143488; cv=none; d=google.com; s=arc-20160816; b=IpwYWyibqbKgYcoS5AUSvUrv+z2ebG0NmgMqUdBAluAh5jj7diIFV9G5wmcOsLo8kt A7wnvOStFISVoLNeJ3uFmb0TELQn/xfEe8osaLBcrfhCQUimbxk81Hoo31cB5wWW1NYq QDLpG/Ssj5GXq3z4cJ6TNBCwXCIw+gvILs9GWt6h0XsMjE+WQ4AG5SY3Jsor2VsxcH9e wN1xvyJRSAzWh5df6W0oXwWZ7ln9KfGKDE8MrxtPpDD9CVEd34ylZNutNmXwghvK/Ti8 AD8qXOsjlEobqCQYtv1XdQuyddBr00bbHgsJmdNAECZoQcR8+wkBdFCwpKqCOWNTUuwR KL1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:openpgp:from:references:cc:to:subject; bh=eOSlZvBN2Ca83BiWTP8n+uA4/rhpoJrl/QSiHK9ZrVo=; b=COMAjs5pj1MdBYNYP+YqdCzZFjir+WXKVnfjFVFtaLqbRqtyiDFvTXqlgjL6vJzaog SarMZ47rYUPHP8uPm2YBxNS5UjpPb8OvIWoWNf92dKraov5Sh1nHxSxA2MgfLPDMllhD nVcCYP4rKJ78QueL2lcJSN34vUucqqkwwIwt7BP3r8F05UxPLe5+5rTYdJzuhuiTiOfu BwO/oV+abZfGhWpG53Eem1ItjP7puJvsYRKzWxXRLrfnqotDpEpFdlm2WrZfz1E278KY DR90U6Z8CE+2cPMWOr2lfmTnE+RjZ9qVqXDn7Cw755rZc7SriY5uuNvv33Apdg+eQUWp sgPw== 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 c6si1725136edv.210.2019.09.10.12.24.24; Tue, 10 Sep 2019 12:24:48 -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 S2437083AbfIJRP5 (ORCPT + 99 others); Tue, 10 Sep 2019 13:15:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46920 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436999AbfIJRP5 (ORCPT ); Tue, 10 Sep 2019 13:15:57 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3656185A07 for ; Tue, 10 Sep 2019 17:15:56 +0000 (UTC) Received: by mail-wr1-f72.google.com with SMTP id x12so9291412wrs.0 for ; Tue, 10 Sep 2019 10:15:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eOSlZvBN2Ca83BiWTP8n+uA4/rhpoJrl/QSiHK9ZrVo=; b=Wd/HLXmIhvt5Ar5wg6+YAB1pekqmmNQrKPBAdcG+S1y3o0a4pi2pDGSTyKRe1JkKEb RmCM8OuoED751owBclG66aN7jAOqyQre6cQT/nRRe1jELWVRIylxbga3Lz41BmRQN4IS ituXJ4Wi2PPTzTPbf9HeCTJLBe2FuutfFX44sfqxYS3Rm/A7DzAWhHcLAtYIbjaGbGSn QSgzYQ0oFYVlAd0CHH5Ubyv3gRTXewa+IdEFnqNFyQV0b2zijbOYeHoL/Wjrfm8Tct2A oXyEs7+Ape38Fu0kMqh+Nz4inYEdqlycUx6eoZM5MxNpi4AUQSVVJR0znlbPHbdt4/rl seRQ== X-Gm-Message-State: APjAAAXdSLwPrHfyhQ1PD3nur31A9aGlhFImcQTJBJawo5Q7bf4Ch9Er TZPDgLBUfVQQyL3lRvHoNrVp99h/Nsfq6XMg+OxHqdQpBWcE9CrXMFCMrWOU+5hozwfSL7xxbmD 5/6RWlGS5dnXoXP8QQG094Ytw X-Received: by 2002:a1c:7414:: with SMTP id p20mr446120wmc.68.1568135754725; Tue, 10 Sep 2019 10:15:54 -0700 (PDT) X-Received: by 2002:a1c:7414:: with SMTP id p20mr446104wmc.68.1568135754464; Tue, 10 Sep 2019 10:15:54 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:1435:25df:c911:3338? ([2001:b07:6468:f312:1435:25df:c911:3338]) by smtp.gmail.com with ESMTPSA id a190sm477474wme.8.2019.09.10.10.15.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Sep 2019 10:15:53 -0700 (PDT) Subject: Re: [PATCH v2] cpuidle-haltpoll: Enable kvm guest polling when dedicated physical CPUs are available To: "Rafael J. Wysocki" , Wanpeng Li Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Marcelo Tosatti , Linux PM References: <1567068597-22419-1-git-send-email-wanpengli@tencent.com> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: <84a0c1b3-4590-6fdb-0b01-915c3f109e65@redhat.com> Date: Tue, 10 Sep 2019 19:15:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/09/19 11:48, Rafael J. Wysocki wrote: > On 8/29/2019 10:49 AM, Wanpeng Li wrote: >> From: Wanpeng Li >> >> The downside of guest side polling is that polling is performed even >> with other runnable tasks in the host. However, even if poll in kvm >> can aware whether or not other runnable tasks in the same pCPU, it >> can still incur extra overhead in over-subscribe scenario. Now we can >> just enable guest polling when dedicated pCPUs are available. >> >> Acked-by: Paolo Bonzini >> Cc: Rafael J. Wysocki >> Cc: Paolo Bonzini >> Cc: Radim Krčmář >> Signed-off-by: Wanpeng Li > > As stated before, I'm going to queue up this change for 5.4, with the > Paolo's ACK. > > BTW, in the future please CC power management changes to > linux-pm@vger.kernel.org for easier handling. Thanks. This patch makes sense to me and I don't know what "limitations" are there in KVM_HINTS_REALTIME that Marcelo mentioned. Any improvements that Marcelo can discuss can be made on top of this during the 5.4 merge window, via the KVM tree. Thanks Rafael for handling the reviewing and merging of this series. Paolo > >> -- >> v1 -> v2: >>   * export kvm_arch_para_hints to fix haltpoll driver build as module >> error >>   * just disable haltpoll driver instead of both driver and governor >>     since KVM_HINTS_REALTIME is not defined in other arches, and governor >>     doesn't depend on x86, to fix the warning on powerpc >> >>   arch/x86/kernel/kvm.c              | 1 + >>   drivers/cpuidle/cpuidle-haltpoll.c | 3 ++- >>   2 files changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c >> index f48401b..68463c1 100644 >> --- a/arch/x86/kernel/kvm.c >> +++ b/arch/x86/kernel/kvm.c >> @@ -711,6 +711,7 @@ unsigned int kvm_arch_para_hints(void) >>   { >>       return cpuid_edx(kvm_cpuid_base() | KVM_CPUID_FEATURES); >>   } >> +EXPORT_SYMBOL_GPL(kvm_arch_para_hints); >>     static uint32_t __init kvm_detect(void) >>   { >> diff --git a/drivers/cpuidle/cpuidle-haltpoll.c >> b/drivers/cpuidle/cpuidle-haltpoll.c >> index 9ac093d..7aee38a 100644 >> --- a/drivers/cpuidle/cpuidle-haltpoll.c >> +++ b/drivers/cpuidle/cpuidle-haltpoll.c >> @@ -53,7 +53,8 @@ static int __init haltpoll_init(void) >>         cpuidle_poll_state_init(drv); >>   -    if (!kvm_para_available()) >> +    if (!kvm_para_available() || >> +        !kvm_para_has_hint(KVM_HINTS_REALTIME)) >>           return 0; >>         ret = cpuidle_register(&haltpoll_driver, NULL); > >