[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <xhsmh7c98d65h.mognet@vschneid-thinkpadt14sgen2i.remote.csb>
Date: Tue, 12 Nov 2024 12:48:42 +0100
From: Valentin Schneider <vschneid@...hat.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, Ingo Molnar
<mingo@...nel.org>, linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Cc: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>, Vincent Guittot
<vincent.guittot@...aro.org>, Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>, Mel
Gorman <mgorman@...e.de>, Nathan Chancellor <nathan@...nel.org>, Nick
Desaulniers <ndesaulniers@...gle.com>, Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>, Andy Shevchenko
<andriy.shevchenko@...ux.intel.com>
Subject: Re: [PATCH v1 1/1] sched/fair: Mark cfs_bandwidth_used() and
m*_vruntime() with __maybe_unused
On 05/09/24 20:12, Andy Shevchenko wrote:
> When cfs_bandwidth_used() is unused, it prevents kernel builds
> with clang, `make W=1` and CONFIG_WERROR=y:
>
> kernel/sched/fair.c:526:19: error: unused function 'max_vruntime' [-Werror,-Wunused-function]
> 526 | static inline u64 max_vruntime(u64 max_vruntime, u64 vruntime)
> | ^~~~~~~~~~~~
> kernel/sched/fair.c:6580:20: error: unused function 'cfs_bandwidth_used' [-Werror,-Wunused-function]
> 6580 | static inline bool cfs_bandwidth_used(void)
> | ^~~~~~~~~~~~~~~~~~
>
> Fix this by marking them with __maybe_unused (all cases for the sake of
> symmetry).
>
I assume that's with CONFIG_CFS_BANDWIDTH=n? Looks like
cfs_bandwidth_used() uses are tucked away under helpers that themselves
only really do something for CONFIG_CFS_BANDWIDTH=y, so you could remove
the CONFIG_CFS_BANDWIDTH=n definition of cfs_bandwidth_used() directly.
This compiles:
---
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 2d16c8545c71e..57abb4ae8af39 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5373,8 +5373,6 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
static void check_enqueue_throttle(struct cfs_rq *cfs_rq);
static inline int cfs_rq_throttled(struct cfs_rq *cfs_rq);
-static inline bool cfs_bandwidth_used(void);
-
static void
requeue_delayed_entity(struct sched_entity *se);
@@ -6754,11 +6752,6 @@ static void sched_fair_update_stop_tick(struct rq *rq, struct task_struct *p)
#else /* CONFIG_CFS_BANDWIDTH */
-static inline bool cfs_bandwidth_used(void)
-{
- return false;
-}
-
static void account_cfs_rq_runtime(struct cfs_rq *cfs_rq, u64 delta_exec) {}
static bool check_cfs_rq_runtime(struct cfs_rq *cfs_rq) { return false; }
static void check_enqueue_throttle(struct cfs_rq *cfs_rq) {}
Powered by blists - more mailing lists