[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230822075801.GA76894@ziqianlu-dell>
Date: Tue, 22 Aug 2023 15:58:01 +0800
From: Aaron Lu <aaron.lu@...el.com>
To: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
CC: Peter Zijlstra <peterz@...radead.org>,
<linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...hat.com>,
Valentin Schneider <vschneid@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>,
"Mel Gorman" <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Juri Lelli <juri.lelli@...hat.com>,
Swapnil Sapkal <Swapnil.Sapkal@....com>,
"Julien Desfossez" <jdesfossez@...italocean.com>, <x86@...nel.org>
Subject: Re: [RFC PATCH v2 2/3] sched: Introduce cpus_share_l2c
On Sat, Aug 19, 2023 at 08:31:55AM -0400, Mathieu Desnoyers wrote:
> +#ifdef TOPOLOGY_CLUSTER_SYSFS
> +static int cpu_get_l2c_info(int cpu, int *l2c_size, int *l2c_id)
> +{
> + const struct cpumask *cluster_mask = topology_cluster_cpumask(cpu);
> +
> + *l2c_size = cpumask_weight(cluster_mask);
> + *l2c_id = cpumask_first(cluster_mask);
> + return 0;
> +}
> +#else
> +static int cpu_get_l2c_info(int cpu, int *l2c_size, int *l2c_id)
> +{
> + return -1;
> +}
> +#endif
> +
> static void update_top_cache_domain(int cpu)
> {
> struct sched_domain_shared *sds = NULL;
> struct sched_domain *sd;
> - int id = cpu;
> - int size = 1;
> + int id = cpu, size = 1, l2c_id, l2c_size;
>
> sd = highest_flag_domain(cpu, SD_SHARE_PKG_RESOURCES);
> if (sd) {
> @@ -686,6 +704,14 @@ static void update_top_cache_domain(int cpu)
> sds = sd->shared;
> }
>
> + if (cpu_get_l2c_info(cpu, &l2c_id, &l2c_size)) {
Should be: cpu_get_l2c_info(cpu, &l2c_size, &l2c_id)
> + /* Fallback on using LLC. */
> + l2c_size = size;
> + l2c_id = id;
> + }
> + per_cpu(sd_l2c_size, cpu) = l2c_size;
> + per_cpu(sd_l2c_id, cpu) = l2c_id;
> +
> rcu_assign_pointer(per_cpu(sd_llc, cpu), sd);
> per_cpu(sd_llc_size, cpu) = size;
> per_cpu(sd_llc_id, cpu) = id;
> --
> 2.39.2
>
Powered by blists - more mailing lists