Message ID | 1670416895-50172-2-git-send-email-lirongqing@baidu.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp157742wrr; Wed, 7 Dec 2022 04:45:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf7z7cIKTf0EJ4KsozArdOgdyrscWBXJoKHsrcSqvpB8bO3XQuqB+OUMHVquYiDPSGl9fshp X-Received: by 2002:a17:906:86ca:b0:7c0:fa2d:bc49 with SMTP id j10-20020a17090686ca00b007c0fa2dbc49mr9880361ejy.438.1670417145484; Wed, 07 Dec 2022 04:45:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670417145; cv=none; d=google.com; s=arc-20160816; b=gtQ38JzI+4sNgytV6xKvu5s4PK/UH81OGYvtda3AMyxLIuxMYZ0+iDL32yeK3Nciow Y1i5q8UJjDO08weqFse5p9mCatfdjuAmx/mlEKpWVJLZLV8j1AHrF2VcKi8X63G6idzR lafD3yj5w8zaB4rZrygI0ktGKvgrpSPRUP3ygDVdCGMdRvvwEGkwpD/Uf7U4YN9vJl4x 6JxdrwgU5GJlWVPqoVyMMUAgsUkOYV9DmFXLgmVDfTx2pZ8mocaimGmplidDOI3TfdGj IdD1tpJqA87zHJUVYfJqVdwRvy36A8Htxpqnj1QRO8g02i7odCoTxnzxvn2jRSHSjOiO ai0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :to:from; bh=zitN1nSb68QVyEGrtJoIx2L/iU+xTthOqxQslhoAa4U=; b=I+yHCICtHQ4mba8elyN98OEZMs5CnYLHPC5f7hihKcx8uXWVm5dWIcykwIvEIq9HL9 MAn+/V4bwB3TfTX7RkdChl73kLObiLns/OBYYDjwcL/AKQT3Op2nxkfn5e2PzepZyhxw PXUcPiCbWOMHPL83RRiqAfgJVl15w0skQkJ66z9D0UfAzFqETKLbsJ9noYVjGfg6p+xw b8nJiSR3SbyUTnfm0d+avOpDcddR9FCQOjbni/heQpRFLaMOpPZfKOufNhuBlHrhkaz8 42ZlXFNyNfK9VGnnT6LsH35MF/iy9V61bQC/HHDDZikdbFWd5acmQVvzZfzwt5eaitDO GwIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b10-20020aa7d48a000000b00469e7011949si3856874edr.508.2022.12.07.04.45.21; Wed, 07 Dec 2022 04:45:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229643AbiLGMll (ORCPT <rfc822;b08248@gmail.com> + 99 others); Wed, 7 Dec 2022 07:41:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbiLGMlj (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 7 Dec 2022 07:41:39 -0500 X-Greylist: delayed 107896 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 07 Dec 2022 04:41:37 PST Received: from mx405.baidu.com (mx414.baidu.com [124.64.201.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D173929C9D; Wed, 7 Dec 2022 04:41:37 -0800 (PST) Received: from bjhw-sys-rpm015653cc5.bjhw.baidu.com (bjhw-sys-rpm015653cc5.bjhw.baidu.com [10.227.53.39]) by mx405.baidu.com (Postfix) with ESMTP id 628521C100053; Wed, 7 Dec 2022 20:41:35 +0800 (CST) Received: from localhost (localhost [127.0.0.1]) by bjhw-sys-rpm015653cc5.bjhw.baidu.com (Postfix) with ESMTP id 5AA83D9933; Wed, 7 Dec 2022 20:41:35 +0800 (CST) From: lirongqing@baidu.com To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, akpm@linux-foundation.org, tony.luck@intel.com, jpoimboe@kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH 2/2][v2] cpuidle-haltpoll: Build as module by default Date: Wed, 7 Dec 2022 20:41:35 +0800 Message-Id: <1670416895-50172-2-git-send-email-lirongqing@baidu.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1670416895-50172-1-git-send-email-lirongqing@baidu.com> References: <1670416895-50172-1-git-send-email-lirongqing@baidu.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751559329083794109?= X-GMAIL-MSGID: =?utf-8?q?1751559329083794109?= |
Series |
[1/2,v2] cpuidle-haltpoll: Replace default_idle with arch_cpu_idle
|
|
Commit Message
Li,Rongqing
Dec. 7, 2022, 12:41 p.m. UTC
From: Li RongQing <lirongqing@baidu.com> Allow user to unload it in running Signed-off-by: Li RongQing <lirongqing@baidu.com> --- drivers/cpuidle/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, Dec 7, 2022 at 1:41 PM <lirongqing@baidu.com> wrote: > > From: Li RongQing <lirongqing@baidu.com> > > Allow user to unload it in running Just like that? And corrupt things left and right while at it? No way. And why do you need this? > Signed-off-by: Li RongQing <lirongqing@baidu.com> > --- > drivers/cpuidle/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/cpuidle/Kconfig b/drivers/cpuidle/Kconfig > index ff71dd6..43ddb84 100644 > --- a/drivers/cpuidle/Kconfig > +++ b/drivers/cpuidle/Kconfig > @@ -74,7 +74,7 @@ endmenu > config HALTPOLL_CPUIDLE > tristate "Halt poll cpuidle driver" > depends on X86 && KVM_GUEST > - default y > + default m > help > This option enables halt poll cpuidle driver, which allows to poll > before halting in the guest (more efficient than polling in the > --
> > Allow user to unload it in running > > Just like that? And corrupt things left and right while at it? > > No way. > > And why do you need this? Cpuidle-haltpoll can not improve performance for all cases, like when guest has mwait, unixbench shows a small performance drop; So change it as module, user can insmod this drivers and rmmod this driver at run time And some downstream os, centos and ubuntu build it module Of cause, it will cause performance drop since it is not installed by default, but user insmod this module, this performance can restore, so I think this is acceptable If this reasom is acceptable, I will add v3; or drop this patch. Thanks -Li
On Thu, Dec 8, 2022 at 3:32 AM Li,Rongqing <lirongqing@baidu.com> wrote: > > > > > Allow user to unload it in running > > > > Just like that? And corrupt things left and right while at it? > > > > No way. > > > > And why do you need this? > > Cpuidle-haltpoll can not improve performance for all cases, like when guest has mwait, unixbench shows a small performance drop; > So change it as module, user can insmod this drivers and rmmod this driver at run time That is problematic, because in the mainline Linux kernel (which is what we are talking about here) there is no support for modular cpuidle governors. Also, there is an interface for switching cpuidle governors at run time already, so why can 't it be used to address this case? > And some downstream os, centos and ubuntu build it module Well, it's their problem.
> Also, there is an interface for switching cpuidle governors at run time already, so > why can 't it be used to address this case? I will study this interface, thanks -Li
On Thu, Dec 8, 2022 at 1:45 PM Li,Rongqing <lirongqing@baidu.com> wrote: > > > Also, there is an interface for switching cpuidle governors at run time already, so > > why can 't it be used to address this case? > > > I will study this interface, thanks Sorry, this patch series is about the haltpoll driver, not the haltpoll governor (which is there too), so you are right, it can be modular, but it is not modular by default. I guess it would be fine to make it modular by default, unless there are expectations regarding it being present on system startup in the field and that part is unclear. I think it would be better to defer this change until it can be clarified.
On Thu, Dec 08, 2022 at 02:32:15AM +0000, Li,Rongqing wrote: > > > > Allow user to unload it in running > > > > Just like that? And corrupt things left and right while at it? > > > > No way. > > > > And why do you need this? > > Cpuidle-haltpoll can not improve performance for all cases, like when > guest has mwait, unixbench shows a small performance drop; So change > it as module, user can insmod this drivers and rmmod this driver at > run time I'm thinking all this can be achieved by a small change to haltpoll_want().
diff --git a/drivers/cpuidle/Kconfig b/drivers/cpuidle/Kconfig index ff71dd6..43ddb84 100644 --- a/drivers/cpuidle/Kconfig +++ b/drivers/cpuidle/Kconfig @@ -74,7 +74,7 @@ endmenu config HALTPOLL_CPUIDLE tristate "Halt poll cpuidle driver" depends on X86 && KVM_GUEST - default y + default m help This option enables halt poll cpuidle driver, which allows to poll before halting in the guest (more efficient than polling in the