lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 22 Aug 2023 07:12:44 -0400
From:   Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To:     Aaron Lu <aaron.lu@...el.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 8/22/23 03:58, Aaron Lu wrote:
> 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)

Good point! Thanks for spotting it. I will fix it in a v3.

Mathieu

> 
>> +		/* 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
>>

-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ