* [PATCH v1 1/1] sched: Remove never used code in mm_cid_get()
@ 2025-10-15 9:19 Andy Shevchenko
2025-10-20 10:10 ` Andy Shevchenko
0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2025-10-15 9:19 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, linux-kernel, llvm
Cc: Ingo Molnar, Juri Lelli, Vincent Guittot, Dietmar Eggemann,
Steven Rostedt, Ben Segall, Mel Gorman, Valentin Schneider,
Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt,
Andy Shevchenko
Clang is not happy with set but unused variable (this is visible
with `make W=1` build:
kernel/sched/sched.h:3744:18: error: variable 'cpumask' set but not used [-Werror,-Wunused-but-set-variable]
It seems like the variable was never be used along with the assignment that
does not have side effects as far as I can see. Remove those altogether.
Fixes: 223baf9d17f2 ("sched: Fix performance regression introduced by mm_cid")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
kernel/sched/sched.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 1f5d07067f60..361f9101cef9 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -3740,11 +3740,9 @@ static inline int mm_cid_get(struct rq *rq, struct task_struct *t,
struct mm_struct *mm)
{
struct mm_cid __percpu *pcpu_cid = mm->pcpu_cid;
- struct cpumask *cpumask;
int cid;
lockdep_assert_rq_held(rq);
- cpumask = mm_cidmask(mm);
cid = __this_cpu_read(pcpu_cid->cid);
if (mm_cid_is_valid(cid)) {
mm_cid_snapshot_time(rq, mm);
--
2.50.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v1 1/1] sched: Remove never used code in mm_cid_get()
2025-10-15 9:19 [PATCH v1 1/1] sched: Remove never used code in mm_cid_get() Andy Shevchenko
@ 2025-10-20 10:10 ` Andy Shevchenko
2025-10-20 10:49 ` Peter Zijlstra
0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2025-10-20 10:10 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, linux-kernel, llvm
Cc: Ingo Molnar, Juri Lelli, Vincent Guittot, Dietmar Eggemann,
Steven Rostedt, Ben Segall, Mel Gorman, Valentin Schneider,
Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt
On Wed, Oct 15, 2025 at 11:19:34AM +0200, Andy Shevchenko wrote:
> Clang is not happy with set but unused variable (this is visible
> with `make W=1` build:
>
> kernel/sched/sched.h:3744:18: error: variable 'cpumask' set but not used [-Werror,-Wunused-but-set-variable]
>
> It seems like the variable was never be used along with the assignment that
> does not have side effects as far as I can see. Remove those altogether.
Anybody to apply this for fixes?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 1/1] sched: Remove never used code in mm_cid_get()
2025-10-20 10:10 ` Andy Shevchenko
@ 2025-10-20 10:49 ` Peter Zijlstra
2025-10-22 16:46 ` Andy Shevchenko
2025-10-24 21:19 ` Eric Biggers
0 siblings, 2 replies; 6+ messages in thread
From: Peter Zijlstra @ 2025-10-20 10:49 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Ingo Molnar, linux-kernel, llvm, Ingo Molnar, Juri Lelli,
Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
Mel Gorman, Valentin Schneider, Nathan Chancellor,
Nick Desaulniers, Bill Wendling, Justin Stitt
On Mon, Oct 20, 2025 at 01:10:44PM +0300, Andy Shevchenko wrote:
> On Wed, Oct 15, 2025 at 11:19:34AM +0200, Andy Shevchenko wrote:
> > Clang is not happy with set but unused variable (this is visible
> > with `make W=1` build:
> >
> > kernel/sched/sched.h:3744:18: error: variable 'cpumask' set but not used [-Werror,-Wunused-but-set-variable]
> >
> > It seems like the variable was never be used along with the assignment that
> > does not have side effects as far as I can see. Remove those altogether.
>
> Anybody to apply this for fixes?
Why? W=1 and WERROR is very much you get to keep the pieces land, no?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 1/1] sched: Remove never used code in mm_cid_get()
2025-10-20 10:49 ` Peter Zijlstra
@ 2025-10-22 16:46 ` Andy Shevchenko
2025-10-24 21:19 ` Eric Biggers
1 sibling, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2025-10-22 16:46 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Ingo Molnar, linux-kernel, llvm, Ingo Molnar, Juri Lelli,
Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
Mel Gorman, Valentin Schneider, Nathan Chancellor,
Nick Desaulniers, Bill Wendling, Justin Stitt
On Mon, Oct 20, 2025 at 12:49:34PM +0200, Peter Zijlstra wrote:
> On Mon, Oct 20, 2025 at 01:10:44PM +0300, Andy Shevchenko wrote:
> > On Wed, Oct 15, 2025 at 11:19:34AM +0200, Andy Shevchenko wrote:
> > > Clang is not happy with set but unused variable (this is visible
> > > with `make W=1` build:
> > >
> > > kernel/sched/sched.h:3744:18: error: variable 'cpumask' set but not used [-Werror,-Wunused-but-set-variable]
> > >
> > > It seems like the variable was never be used along with the assignment that
> > > does not have side effects as far as I can see. Remove those altogether.
> >
> > Anybody to apply this for fixes?
>
> Why? W=1 and WERROR is very much you get to keep the pieces land, no?
The builds I have almost W=1 clean, I have only a couple of patches which I try
to push forward (already for a few releases). Your patch to move static inline
unused function warning to level 2 would drop them, leaving the above the only
culprit so far.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 1/1] sched: Remove never used code in mm_cid_get()
2025-10-20 10:49 ` Peter Zijlstra
2025-10-22 16:46 ` Andy Shevchenko
@ 2025-10-24 21:19 ` Eric Biggers
2025-10-24 23:56 ` Linus Torvalds
1 sibling, 1 reply; 6+ messages in thread
From: Eric Biggers @ 2025-10-24 21:19 UTC (permalink / raw)
To: Peter Zijlstra, Linus Torvalds
Cc: Andy Shevchenko, Ingo Molnar, linux-kernel, llvm, Ingo Molnar,
Juri Lelli, Vincent Guittot, Dietmar Eggemann, Steven Rostedt,
Ben Segall, Mel Gorman, Valentin Schneider, Nathan Chancellor,
Nick Desaulniers, Bill Wendling, Justin Stitt
On Mon, Oct 20, 2025 at 12:49:34PM +0200, Peter Zijlstra wrote:
> On Mon, Oct 20, 2025 at 01:10:44PM +0300, Andy Shevchenko wrote:
> > On Wed, Oct 15, 2025 at 11:19:34AM +0200, Andy Shevchenko wrote:
> > > Clang is not happy with set but unused variable (this is visible
> > > with `make W=1` build:
> > >
> > > kernel/sched/sched.h:3744:18: error: variable 'cpumask' set but not used [-Werror,-Wunused-but-set-variable]
> > >
> > > It seems like the variable was never be used along with the assignment that
> > > does not have side effects as far as I can see. Remove those altogether.
> >
> > Anybody to apply this for fixes?
>
> Why? W=1 and WERROR is very much you get to keep the pieces land, no?
Tested-by: Eric Biggers <ebiggers@kernel.org>
Linus, could you consider applying this directly? This seems to have
broken W=1 for basically the whole kernel. I see many other people
already ran into this and sent the same patch
(https://lore.kernel.org/r/20251002-sched-w1-v1-1-a6fdf549d179@linaro.org
https://lore.kernel.org/r/20251009194818.1587650-1-kriish.sharma2006@gmail.com
https://lore.kernel.org/r/20251017073050.2411988-1-kevin.brodsky@arm.com
https://lore.kernel.org/r/20251020220601.176639-1-adigollamudi@gmail.com)
but unfortunately the maintainer is refusing to apply any of them.
I find W=1 to be useful, and I keep my subsystems W=1 clean. But I
cannot do that if W=1 is broken for all kernel builds.
I think it's clear that a lot of other people find it useful too.
- Eric
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 1/1] sched: Remove never used code in mm_cid_get()
2025-10-24 21:19 ` Eric Biggers
@ 2025-10-24 23:56 ` Linus Torvalds
0 siblings, 0 replies; 6+ messages in thread
From: Linus Torvalds @ 2025-10-24 23:56 UTC (permalink / raw)
To: Eric Biggers
Cc: Peter Zijlstra, Andy Shevchenko, Ingo Molnar, linux-kernel, llvm,
Ingo Molnar, Juri Lelli, Vincent Guittot, Dietmar Eggemann,
Steven Rostedt, Ben Segall, Mel Gorman, Valentin Schneider,
Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt
On Fri, 24 Oct 2025 at 14:19, Eric Biggers <ebiggers@kernel.org> wrote:
>
> Linus, could you consider applying this directly?
Done.
Linus
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-10-24 23:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-15 9:19 [PATCH v1 1/1] sched: Remove never used code in mm_cid_get() Andy Shevchenko
2025-10-20 10:10 ` Andy Shevchenko
2025-10-20 10:49 ` Peter Zijlstra
2025-10-22 16:46 ` Andy Shevchenko
2025-10-24 21:19 ` Eric Biggers
2025-10-24 23:56 ` Linus Torvalds
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox