Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4365139ybf; Wed, 4 Mar 2020 02:31:56 -0800 (PST) X-Google-Smtp-Source: ADFU+vsQ9cMMHdwVvVgfFDBiIS3woxlcn3pfRuQcb9k3MsI50imdieyxof/gqVsM79HHdZosQYJz X-Received: by 2002:a9d:6b98:: with SMTP id b24mr1793984otq.200.1583317916487; Wed, 04 Mar 2020 02:31:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583317916; cv=none; d=google.com; s=arc-20160816; b=erdT+A8JhkhWWun5ZpNFmKGL/Oj/WXnJ3qJ2NTOCl5y4qD1zN0R+hvqguXdEU1V1To +3SERWzG82xuQwtvKLDXQZS4JWCz69EdPM9uXLk8IUvtrCasLTByXakEnnCorVchwqm2 xIRo0Yhrp36qYao/NZqudVAVYI5c5VLt4iCsk84IDkC4juP9AcouShRi2L3LqgSKgQhL C6989HF7w2It7jtyWilSnfnqeCmmyzl3GRy939VF67uYLvR02yOO802r6BheaklcYkat 9N8mj3sYbXyxtD3R3e0bFDQj1CtlzabZbEwiZvOr+pWGgkkwcLvgBofGboZ5xpss5C4r /Rkg== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=6JSTx+nsYfbwed6VQp215cez4zz3xQi/iVK4AI2e0sg=; b=HavgarqHRWtib4SepbzOc/zmQGIBKhdYLzHn/Cz65APtaWsfMXlcRxvR/mfxY0cfD4 35Bqn3agLnBIIh7LPs3iLKkmcTDt+ex7N3X6xe4dcmbBVqdvsJ7kYTx4DWX9dYT3w8+L Amep7hoAEOvFcetz9NmE2NMTWwleflnDPr2cxHCGGceA66A79a89Px0mT9HlsklhdWxH odC2u9UVuHHR2RPv/KxNSO88QNGR5YgTDGViEaouGtwlOv3k7RiHso7HZxbwksKHtbnt 5JtmamRl3lA/623tB3HstfoOp3wW/JyoTfPl3BXKVBFdOpXuwsUlIB60IBEhIsZpX5js 8O3A== 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 q16si849427otc.293.2020.03.04.02.31.44; Wed, 04 Mar 2020 02:31:56 -0800 (PST) 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 S2387772AbgCDKbf (ORCPT + 99 others); Wed, 4 Mar 2020 05:31:35 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:44817 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726137AbgCDKbe (ORCPT ); Wed, 4 Mar 2020 05:31:34 -0500 Received: from 79.184.237.41.ipv4.supernova.orange.pl (79.184.237.41) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.341) id f2ea0c19e76830b0; Wed, 4 Mar 2020 11:31:32 +0100 From: "Rafael J. Wysocki" To: "Maciej S. Szmigiero" Cc: Daniel Lezcano , Joao Martins , Boris Ostrovsky , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Marcelo Tosatti , kvm@vger.kernel.org Subject: Re: [PATCH] cpuidle-haltpoll: allow force loading on hosts without the REALTIME hint Date: Wed, 04 Mar 2020 11:31:31 +0100 Message-ID: <2118832.28snYOIflM@kreacher> In-Reply-To: <75d483b5-8edf-efb1-9642-ca367e2f1423@maciej.szmigiero.name> References: <20200221174331.1480468-1-mail@maciej.szmigiero.name> <75d483b5-8edf-efb1-9642-ca367e2f1423@maciej.szmigiero.name> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit 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 Friday, February 28, 2020 6:10:18 PM CET Maciej S. Szmigiero wrote: > A friendly ping here. > > Maciej > > On 21.02.2020 18:43, Maciej S. Szmigiero wrote: > > From: "Maciej S. Szmigiero" > > > > Before commit 1328edca4a14 ("cpuidle-haltpoll: Enable kvm guest polling > > when dedicated physical CPUs are available") the cpuidle-haltpoll driver > > could also be used in scenarios when the host does not advertise the > > KVM_HINTS_REALTIME hint. > > > > While the behavior introduced by the aforementioned commit makes sense as > > the default there are cases where the old behavior is desired, for example, > > when other kernel changes triggered by presence by this hint are unwanted, > > for some workloads where the latency benefit from polling overweights the > > loss from idle CPU capacity that otherwise would be available, or just when > > running under older Qemu versions that lack this hint. > > > > Let's provide a typical "force" module parameter that allows restoring the > > old behavior. > > > > Signed-off-by: Maciej S. Szmigiero > > --- > > drivers/cpuidle/cpuidle-haltpoll.c | 12 +++++++++++- > > 1 file changed, 11 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-haltpoll.c > > index b0ce9bc78113..07e5b36076bb 100644 > > --- a/drivers/cpuidle/cpuidle-haltpoll.c > > +++ b/drivers/cpuidle/cpuidle-haltpoll.c > > @@ -18,6 +18,11 @@ > > #include > > #include > > > > +static bool force __read_mostly; > > +module_param(force, bool, 0444); > > +MODULE_PARM_DESC(force, > > + "Load even if the host does not provide the REALTIME hint"); Why not to say "Load unconditionally" here? As is, one needs to know what "the REALTIME hint" is to understand it. > > + > > static struct cpuidle_device __percpu *haltpoll_cpuidle_devices; > > static enum cpuhp_state haltpoll_hp_state; > > > > @@ -90,6 +95,11 @@ static void haltpoll_uninit(void) > > haltpoll_cpuidle_devices = NULL; > > } > > > > +static bool haltpool_want(void) > > +{ > > + return kvm_para_has_hint(KVM_HINTS_REALTIME) || force; > > +} > > + > > static int __init haltpoll_init(void) > > { > > int ret; > > @@ -102,7 +112,7 @@ static int __init haltpoll_init(void) > > cpuidle_poll_state_init(drv); > > > > if (!kvm_para_available() || > > - !kvm_para_has_hint(KVM_HINTS_REALTIME)) > > + !haltpool_want()) And you don't need to break this line. > > return -ENODEV; > > > > ret = cpuidle_register_driver(drv); > > > > Thanks!