[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220315092911.GD8939@worktop.programming.kicks-ass.net>
Date: Tue, 15 Mar 2022 10:29:11 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Qing Wang <wangqing@...o.com>
Cc: Russell King <linux@...linux.org.uk>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Sudeep Holla <sudeep.holla@....com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Ingo Molnar <mingo@...hat.com>,
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>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org
Subject: Re: [PATCH] sched: dynamic config sd_flags if described in DT
On Tue, Mar 15, 2022 at 12:58:54AM -0700, Qing Wang wrote:
> --- a/kernel/sched/topology.c
> +++ b/kernel/sched/topology.c
> @@ -1527,6 +1527,7 @@ sd_init(struct sched_domain_topology_level *tl,
> struct sched_domain *sd = *per_cpu_ptr(sdd->sd, cpu);
> int sd_id, sd_weight, sd_flags = 0;
> struct cpumask *sd_span;
> + int ret;
>
> #ifdef CONFIG_NUMA
> /*
> @@ -1539,6 +1540,15 @@ sd_init(struct sched_domain_topology_level *tl,
>
> if (tl->sd_flags)
> sd_flags = (*tl->sd_flags)();
> +
> +#ifdef CONFIG_GENERIC_ARCH_TOPOLOGY
> + ret = cpus_share_self_cache(cpu_map);
> + if (ret == 1)
> + sd_flags |= SD_SHARE_PKG_RESOURCES;
> + else if (ret == 0)
> + sd_flags &= ~SD_SHARE_PKG_RESOURCES;
> +#endif
> +
> if (WARN_ONCE(sd_flags & ~TOPOLOGY_SD_FLAGS,
> "wrong sd_flags in topology description\n"))
> sd_flags &= TOPOLOGY_SD_FLAGS;
Still NAK, you don't have to touch generic code for any of this.
Powered by blists - more mailing lists