[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z8sX5VtKuBD1BoiB@jlelli-thinkpadt14gen4.remote.csb>
Date: Fri, 7 Mar 2025 15:59:33 +0000
From: Juri Lelli <juri.lelli@...hat.com>
To: Waiman Long <llong@...hat.com>
Cc: linux-kernel@...r.kernel.org, cgroups@...r.kernel.org,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
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>,
Valentin Schneider <vschneid@...hat.com>, Tejun Heo <tj@...nel.org>,
Johannes Weiner <hannes@...xchg.org>,
Michal Koutný <mkoutny@...e.com>,
Qais Yousef <qyousef@...alina.io>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Swapnil Sapkal <swapnil.sapkal@....com>,
Shrikanth Hegde <sshegde@...ux.ibm.com>,
Phil Auld <pauld@...hat.com>, luca.abeni@...tannapisa.it,
tommaso.cucinotta@...tannapisa.it,
Jon Hunter <jonathanh@...dia.com>
Subject: Re: [PATCH v2 2/8] sched/topology: Wrappers for sched_domains_mutex
On 07/03/25 10:19, Waiman Long wrote:
>
> On 3/7/25 10:11 AM, Waiman Long wrote:
> > On 3/6/25 9:10 AM, Juri Lelli wrote:
> > > Create wrappers for sched_domains_mutex so that it can transparently be
> > > used on both CONFIG_SMP and !CONFIG_SMP, as some function will need to
> > > do.
> > >
> > > Reported-by: Jon Hunter <jonathanh@...dia.com>
> > > Fixes: 53916d5fd3c0 ("sched/deadline: Check bandwidth overflow
> > > earlier for hotplug")
> > > Signed-off-by: Juri Lelli <juri.lelli@...hat.com>
> > > ---
> > > v1 -> v2: Remove wrappers for the !SMP case as all users are not defined
> > > either in that case
> > > ---
> > > include/linux/sched.h | 2 ++
> > > kernel/cgroup/cpuset.c | 4 ++--
> > > kernel/sched/core.c | 4 ++--
> > > kernel/sched/debug.c | 8 ++++----
> > > kernel/sched/topology.c | 12 ++++++++++--
> > > 5 files changed, 20 insertions(+), 10 deletions(-)
> > >
> > > diff --git a/include/linux/sched.h b/include/linux/sched.h
> > > index 9632e3318e0d..d5f8c161d852 100644
> > > --- a/include/linux/sched.h
> > > +++ b/include/linux/sched.h
> > > @@ -383,6 +383,8 @@ enum uclamp_id {
> > > extern struct root_domain def_root_domain;
> > > extern struct mutex sched_domains_mutex;
> > > #endif
> > > +extern void sched_domains_mutex_lock(void);
> > > +extern void sched_domains_mutex_unlock(void);
> >
> > As discussed in the other thread, move the
> > sched_domains_mutex_{lock/unlock}{} inside the "#if CONFIG_SMP" block
> > and define the else part so that it can be used in code block that will
> > also be compiled in the !CONFIG_SMP case.
> >
> > Other than that, the rest looks good to me.
>
> Actually, you can also remove sched_domains_mutex from the header and make
> it static as it is no longer directly accessed.
Apart from a lockdep_assert_held() in cpuset.c, no? Guess I can create a
wrapper for that, but is it really better?
Thanks,
Juri
Powered by blists - more mailing lists