Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp870239ybf; Fri, 28 Feb 2020 09:11:09 -0800 (PST) X-Google-Smtp-Source: APXvYqxoO87t6wflgRR9KtBw055gtfAlhk/xt20Ux2xJAmosbRZqEUph7XlfeXKvAPmkD4t04L8S X-Received: by 2002:a05:6830:1e76:: with SMTP id m22mr4350722otr.295.1582909869530; Fri, 28 Feb 2020 09:11:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582909869; cv=none; d=google.com; s=arc-20160816; b=bpjIt938r0zRlmxuP6JObQ2MBj0yQXeYR8EzRZrw42WCHR7DeqYFfRxIWyThVldTUF hxf7F++aj6N5uF+UgTracp7VLl65KxbK0KYeHafEN6quINAnkuhAHKWPYQxw8V7hDlbs 1afMWyPtaARNjRxhHgoy85f75MAaCVupvu8XOc7phy4xcqXmn/uiGcKh8pLicZ+hF/+q apw62M2NSv5Ah9UUyWERA0w9wu/H19r/uNs2+Z/8vea6A+/AxXbUa3FrybFYvUqB3/l4 Bwq/PtYb46DIvhzdMogp+EFUwKmTJYlOVlrl/96bRT5JAfINU22d6JgjRje9byDXFghm 0j+g== 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:autocrypt:references:cc:to:from:subject; bh=shBm3KW9kqSWFtl0v/0feVenXSxUNJ0KZEG7HAnXjwI=; b=dtMHWE0jT4PWQ0EenauJ2p/x410FwiB4UGbuQxBMx36NGeeghyYh/emLIQF1yTkTGe 27sN2Gspn4DIJ31slZOWGT67ftD3TIkiZpUNVehGfSLeMzr4LAc43R/4HKZg9Rw24eWk 6Hjfph5IZYFdoetXkf4JnL1yyrn0T2YdJI1hnHtCTxG/Lwn6Rg5ErXxkBCPC1t8HCZSv PDHG5TFYQCbxpzIvMtOPawQOAx2yjR8rz+NZ+DsqschzmGlpbgIhwj0ir52Anu+eqlTp 31y/1X9S7Dpy0edRsuU8U94i158RhmXHYnG0duTf1rtp8Rhuos7xV6mHNZMBPNnAiTX6 1CGA== 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 i23si1766973oto.206.2020.02.28.09.10.56; Fri, 28 Feb 2020 09:11:09 -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 S1726525AbgB1RK1 (ORCPT + 99 others); Fri, 28 Feb 2020 12:10:27 -0500 Received: from vps-vb.mhejs.net ([37.28.154.113]:43224 "EHLO vps-vb.mhejs.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbgB1RK1 (ORCPT ); Fri, 28 Feb 2020 12:10:27 -0500 Received: from MUA by vps-vb.mhejs.net with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) (envelope-from ) id 1j7j9b-0006mL-La; Fri, 28 Feb 2020 18:10:23 +0100 Subject: Re: [PATCH] cpuidle-haltpoll: allow force loading on hosts without the REALTIME hint From: "Maciej S. Szmigiero" To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Joao Martins , Boris Ostrovsky , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Marcelo Tosatti , kvm@vger.kernel.org References: <20200221174331.1480468-1-mail@maciej.szmigiero.name> Autocrypt: addr=mail@maciej.szmigiero.name; prefer-encrypt=mutual; keydata= mQINBFpGusUBEADXUMM2t7y9sH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TnW6/65JRFNlEQ6Wsbx/0C90 KWkF9R7DLtcVxno75+pXiXDdy9bq54uQeT+9dr+EdyVL0H3eTzP9js7GrRahuHD6/AxekQwX afDLYnExRXL7acu5a1fUpDKWe/CigtyjJz73Dvs9eV7Wvk69TFV60Ft84UEqNBqSha7s1/m8 tQW4InvfnL9h0LWVvwUZe5HKCPe65amwBOvwkkYd4OfNb0NDVudTMsCYLJ8al57zLelH2hcS wOiVdXBsbePjzLy2exEXUb1bHFjBoHnHX6uszBOzM/Dv1eNWJPZ3r3PRFnQk/D9ohEXVEmUI TLDd7lR06Nr8J4oG1RprRTW1T8xE6lSwbfsp9ApU1QuDZzSI1hdNpDYRVUmQeiXnSjR1YBVb zOyMU+hnnsQZMdTQ2qVFZs4JGCA9/wSOMMsohDbJNX2iGR1S+RFpZY9sipuGBVM7wIVrz4Ac Iw== Message-ID: <75d483b5-8edf-efb1-9642-ca367e2f1423@maciej.szmigiero.name> Date: Fri, 28 Feb 2020 18:10:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200221174331.1480468-1-mail@maciej.szmigiero.name> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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"); > + > 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()) > return -ENODEV; > > ret = cpuidle_register_driver(drv); >