[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20241025040026.1683576-1-zengheng4@huawei.com>
Date: Fri, 25 Oct 2024 12:00:26 +0800
From: Zeng Heng <zengheng4@...wei.com>
To: <vschneid@...hat.com>, <bsegall@...gle.com>, <juri.lelli@...hat.com>,
<peterz@...radead.org>, <changhuaixin@...ux.alibaba.com>, <mgorman@...e.de>,
<rostedt@...dmis.org>, <mingo@...hat.com>, <vincent.guittot@...aro.org>,
<dietmar.eggemann@....com>
CC: <bobo.shaobowang@...wei.com>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] sched/rt: Fix not used variable 'max_rt_runtime'
Fix the following compilation warning:
kernel/sched/rt.c:9:18: warning: ‘max_rt_runtime’ defined but not used
[-Wunused-const-variable=]
9 | static const u64 max_rt_runtime = MAX_BW;
Only define the const variables when the CONFIG_SYSCTL or
CONFIG_RT_GROUP_SCHED is enabled.
Fixes: d505b8af5891 ("sched: Defend cfs and rt bandwidth quota against overflow")
Signed-off-by: Zeng Heng <zengheng4@...wei.com>
---
kernel/sched/rt.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 172c588de542..0957f44b2eda 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -5,8 +5,10 @@
*/
int sched_rr_timeslice = RR_TIMESLICE;
+#if defined(CONFIG_SYSCTL) || defined(CONFIG_RT_GROUP_SCHED)
/* More than 4 hours if BW_SHIFT equals 20. */
static const u64 max_rt_runtime = MAX_BW;
+#endif
/*
* period over which we measure -rt task CPU usage in us.
--
2.25.1
Powered by blists - more mailing lists