From patchwork Thu Nov 25 08:54:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maulik Shah X-Patchwork-Id: 12638703 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2F6EC433EF for ; Thu, 25 Nov 2021 08:57:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353596AbhKYJAa (ORCPT ); Thu, 25 Nov 2021 04:00:30 -0500 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:48609 "EHLO alexa-out-sd-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349919AbhKYI63 (ORCPT ); Thu, 25 Nov 2021 03:58:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1637830518; x=1669366518; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=rYTFnQt9ItpKOd8BhGrsiijq2+oxO3mBTT9Ukp8O3uw=; b=rg+Y4Q9jDMJf0P/O+kpfgm5JASpwZUZz3Y7jPYMdeZTnyVJQCEKEJJrn MZtRe+FS+Wzg6nB3NEgnlcsSqwUB4CM3KgmSu4q7UhZX+Ve8YKUDY8XcV kuEkPag9A2smTn2aYss8dXnclADV+J0U/R44sfnIkE8Ngv3n9HfjijZWK 4=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-02.qualcomm.com with ESMTP; 25 Nov 2021 00:55:18 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Nov 2021 00:55:17 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Thu, 25 Nov 2021 00:55:17 -0800 Received: from mkshah-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Thu, 25 Nov 2021 00:55:13 -0800 From: Maulik Shah To: , , CC: , , , , , , Maulik Shah , Frederic Weisbecker , "Thomas Gleixner" , Ingo Molnar Subject: [PATCH 1/4] tick/sched: Export symbols used by cpuidle governors Date: Thu, 25 Nov 2021 14:24:38 +0530 Message-ID: <1637830481-21709-2-git-send-email-quic_mkshah@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1637830481-21709-1-git-send-email-quic_mkshah@quicinc.com> References: <1637830481-21709-1-git-send-email-quic_mkshah@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Export symbols that are used by cpuidle menu, ladder and teo governors in preparation to allow cpuidle governors to be compiled as modules. Cc: Frederic Weisbecker Cc: Thomas Gleixner Cc: Ingo Molnar Signed-off-by: Maulik Shah --- kernel/time/tick-sched.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 6bffe5af..7cc6619 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -573,6 +573,8 @@ void __init tick_nohz_init(void) * NO HZ enabled ? */ bool tick_nohz_enabled __read_mostly = true; +EXPORT_SYMBOL(tick_nohz_enabled); + unsigned long tick_nohz_active __read_mostly; /* * Enable / Disable tickless mode @@ -590,6 +592,7 @@ bool tick_nohz_tick_stopped(void) return ts->tick_stopped; } +EXPORT_SYMBOL(tick_nohz_tick_stopped); bool tick_nohz_tick_stopped_cpu(int cpu) { @@ -1147,6 +1150,7 @@ bool tick_nohz_idle_got_tick(void) } return false; } +EXPORT_SYMBOL(tick_nohz_idle_got_tick); /** * tick_nohz_get_next_hrtimer - return the next expiration time for the hrtimer @@ -1202,6 +1206,7 @@ ktime_t tick_nohz_get_sleep_length(ktime_t *delta_next) return ktime_sub(next_event, now); } +EXPORT_SYMBOL(tick_nohz_get_sleep_length); /** * tick_nohz_get_idle_calls_cpu - return the current idle calls counter value From patchwork Thu Nov 25 08:54:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maulik Shah X-Patchwork-Id: 12638705 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04240C433EF for ; Thu, 25 Nov 2021 08:57:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353623AbhKYJAf (ORCPT ); Thu, 25 Nov 2021 04:00:35 -0500 Received: from alexa-out.qualcomm.com ([129.46.98.28]:12103 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350301AbhKYI6e (ORCPT ); Thu, 25 Nov 2021 03:58:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1637830524; x=1669366524; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=zI8HnoiSucW+m3HzAX/1TZ5pfXq//afqM7JCFEu2xDQ=; b=RrLi7vN3hh6odTWsZOmTNe0LTA5/cq1RG+BnatNhXiB3vFruV8humMyW Qt7ph0B9s4wxib783l/WgsEAEGK/k7X0kR50OAf+QU83fYDx7BkEg0NB7 Ash7hr8NqyxKYOB5mqXGTlh3QquO634pGQg/avicKoh5Ngr4VPFtbmT1H E=; Received: from ironmsg07-lv.qualcomm.com ([10.47.202.151]) by alexa-out.qualcomm.com with ESMTP; 25 Nov 2021 00:55:23 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg07-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Nov 2021 00:55:23 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Thu, 25 Nov 2021 00:55:22 -0800 Received: from mkshah-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Thu, 25 Nov 2021 00:55:17 -0800 From: Maulik Shah To: , , CC: , , , , , , Maulik Shah , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot Subject: [PATCH 2/4] sched/core: Export symbols used by cpuidle governors Date: Thu, 25 Nov 2021 14:24:39 +0530 Message-ID: <1637830481-21709-3-git-send-email-quic_mkshah@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1637830481-21709-1-git-send-email-quic_mkshah@quicinc.com> References: <1637830481-21709-1-git-send-email-quic_mkshah@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Export symbols that are used by cpuidle menu governor in preparation to allow cpuidle governors to be compiled as modules. Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Juri Lelli Cc: Vincent Guittot Signed-off-by: Maulik Shah --- kernel/sched/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 8cffe31..1d031e0 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5047,6 +5047,7 @@ unsigned int nr_iowait_cpu(int cpu) { return atomic_read(&cpu_rq(cpu)->nr_iowait); } +EXPORT_SYMBOL(nr_iowait_cpu); /* * IO-wait accounting, and how it's mostly bollocks (on SMP). From patchwork Thu Nov 25 08:54:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maulik Shah X-Patchwork-Id: 12638707 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8E84C433F5 for ; Thu, 25 Nov 2021 08:57:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350560AbhKYJAi (ORCPT ); Thu, 25 Nov 2021 04:00:38 -0500 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:48685 "EHLO alexa-out-sd-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350361AbhKYI6h (ORCPT ); Thu, 25 Nov 2021 03:58:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1637830526; x=1669366526; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=dfRuXPdPGQsBADa9ddCE8eydyZN8hMqgt9lGqyTcLas=; b=p0zkMD2W7xyHycKs9pIpxPF55LKLibherHXsyyYmRt8y6Vtd4rovHu88 7W8BZs8qANeGaxG17pDLjzeVDKVIC0FEQKXrDGmDNsAPO/ywyEtFFtd85 7S0L+15h/pkl3RGKSCm3hNYvNH8GJ3jKk6a0W/I/fqrZdBQozLrkKvoXu 0=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-02.qualcomm.com with ESMTP; 25 Nov 2021 00:55:26 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Nov 2021 00:55:26 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Thu, 25 Nov 2021 00:55:26 -0800 Received: from mkshah-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Thu, 25 Nov 2021 00:55:22 -0800 From: Maulik Shah To: , , CC: , , , , , , Lina Iyer , Maulik Shah Subject: [PATCH 3/4] cpuidle: governor: export cpuidle governor functions Date: Thu, 25 Nov 2021 14:24:40 +0530 Message-ID: <1637830481-21709-4-git-send-email-quic_mkshah@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1637830481-21709-1-git-send-email-quic_mkshah@quicinc.com> References: <1637830481-21709-1-git-send-email-quic_mkshah@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Lina Iyer Commit 83788c0caed3 ("cpuidle: remove unused exports") removed capability of registering cpuidle governors, which was unused at that time. By exporting the symbol, let's allow platform specific modules to register cpuidle governors and use cpuidle_governor_latency_req() to get the QoS for the CPU. Signed-off-by: Lina Iyer Signed-off-by: Maulik Shah --- drivers/cpuidle/governor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/cpuidle/governor.c b/drivers/cpuidle/governor.c index 29acaf4..0e51ed2 100644 --- a/drivers/cpuidle/governor.c +++ b/drivers/cpuidle/governor.c @@ -102,6 +102,7 @@ int cpuidle_register_governor(struct cpuidle_governor *gov) return ret; } +EXPORT_SYMBOL_GPL(cpuidle_register_governor); /** * cpuidle_governor_latency_req - Compute a latency constraint for CPU @@ -118,3 +119,4 @@ s64 cpuidle_governor_latency_req(unsigned int cpu) return (s64)device_req * NSEC_PER_USEC; } +EXPORT_SYMBOL_GPL(cpuidle_governor_latency_req); From patchwork Thu Nov 25 08:54:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maulik Shah X-Patchwork-Id: 12638709 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD497C433FE for ; Thu, 25 Nov 2021 08:57:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353757AbhKYJAm (ORCPT ); Thu, 25 Nov 2021 04:00:42 -0500 Received: from alexa-out.qualcomm.com ([129.46.98.28]:45906 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353137AbhKYI6l (ORCPT ); Thu, 25 Nov 2021 03:58:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1637830531; x=1669366531; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=C1SMImgKRYYI+V5asR9+c50EUAXTpvbf8imgtE5v1XQ=; b=VwkQKi0e9BEOvwe6aZAOmCEDpH1EucFbjJR3ByoC3pX5JGBixhZTHhVX tyYzmG+xln4+HotdEwXHVwKSy7kArv6xpXjE493XfXoVkhcXee8Nv1k8C hczER3MNraoTykYboo8XMwdA3Bae7GTJbWPaIiGndGzwh2Qr28c7KcFGV 8=; Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 25 Nov 2021 00:55:30 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Nov 2021 00:55:30 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Thu, 25 Nov 2021 00:55:29 -0800 Received: from mkshah-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Thu, 25 Nov 2021 00:55:26 -0800 From: Maulik Shah To: , , CC: , , , , , , Maulik Shah Subject: [PATCH 4/4] cpuidle: governors: Allow the governors to be compiled as modules Date: Thu, 25 Nov 2021 14:24:41 +0530 Message-ID: <1637830481-21709-5-git-send-email-quic_mkshah@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1637830481-21709-1-git-send-email-quic_mkshah@quicinc.com> References: <1637830481-21709-1-git-send-email-quic_mkshah@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Allow the menu, ladder and teo governors to be compiled as modules when building allmodconfig. Signed-off-by: Maulik Shah --- drivers/cpuidle/Kconfig | 6 +++--- drivers/cpuidle/governors/ladder.c | 4 ++++ drivers/cpuidle/governors/menu.c | 4 ++++ drivers/cpuidle/governors/teo.c | 4 ++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/cpuidle/Kconfig b/drivers/cpuidle/Kconfig index c0aeedd..d71e3e4 100644 --- a/drivers/cpuidle/Kconfig +++ b/drivers/cpuidle/Kconfig @@ -19,13 +19,13 @@ config CPU_IDLE_MULTIPLE_DRIVERS bool config CPU_IDLE_GOV_LADDER - bool "Ladder governor (for periodic timer tick)" + tristate "Ladder governor (for periodic timer tick)" config CPU_IDLE_GOV_MENU - bool "Menu governor (for tickless system)" + tristate "Menu governor (for tickless system)" config CPU_IDLE_GOV_TEO - bool "Timer events oriented (TEO) governor (for tickless systems)" + tristate "Timer events oriented (TEO) governor (for tickless systems)" help This governor implements a simplified idle state selection method focused on timer events and does not do any interactivity boosting. diff --git a/drivers/cpuidle/governors/ladder.c b/drivers/cpuidle/governors/ladder.c index 8e9058c..4de5b3d 100644 --- a/drivers/cpuidle/governors/ladder.c +++ b/drivers/cpuidle/governors/ladder.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -195,3 +196,6 @@ static int __init init_ladder(void) } postcore_initcall(init_ladder); + +MODULE_DESCRIPTION("CPUidle Ladder governor (for periodic timer tick)"); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c index 2e56704..2ef7cfc 100644 --- a/drivers/cpuidle/governors/menu.c +++ b/drivers/cpuidle/governors/menu.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -577,3 +578,6 @@ static int __init init_menu(void) } postcore_initcall(init_menu); + +MODULE_DESCRIPTION("CPUidle Menu governor (for tickless system)"); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/cpuidle/governors/teo.c b/drivers/cpuidle/governors/teo.c index d9262db..1a1d9ef 100644 --- a/drivers/cpuidle/governors/teo.c +++ b/drivers/cpuidle/governors/teo.c @@ -104,6 +104,7 @@ #include #include #include +#include #include #include @@ -532,3 +533,6 @@ static int __init teo_governor_init(void) } postcore_initcall(teo_governor_init); + +MODULE_DESCRIPTION("CPUidle Timer events oriented (TEO) governor (for tickless systems)"); +MODULE_LICENSE("GPL v2");