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] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 11 Jul 2016 17:16:06 +0100
From:	Dietmar Eggemann <dietmar.eggemann@....com>
To:	Peter Zijlstra <peterz@...radead.org>,
	Morten Rasmussen <morten.rasmussen@....com>
Cc:	mingo@...hat.com, yuyang.du@...el.com, vincent.guittot@...aro.org,
	mgalbraith@...e.de, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 06/13] sched: Store maximum per-cpu capacity in root
 domain

On 11/07/16 11:18, Peter Zijlstra wrote:
> On Wed, Jun 22, 2016 at 06:03:17PM +0100, Morten Rasmussen wrote:
>> @@ -6905,11 +6906,19 @@ static int build_sched_domains(const struct cpumask *cpu_map,
>>  	/* Attach the domains */
>>  	rcu_read_lock();
>>  	for_each_cpu(i, cpu_map) {
>> +		rq = cpu_rq(i);
>>  		sd = *per_cpu_ptr(d.sd, i);
>>  		cpu_attach_domain(sd, d.rd, i);
>> +
>> +		if (rq->cpu_capacity_orig > rq->rd->max_cpu_capacity)
>> +			rq->rd->max_cpu_capacity = rq->cpu_capacity_orig;
>>  	}
> 
> Should you not set that _before_ cpu_attach_domain(), such that the
> state is up-to-date when its published?

yes, much better.

> Also, since its lockless, should we not use {READ,WRITE}_ONCE() with it?

You mean for rq->rd->max_cpu_capacity ? IMHO, there is a data dependency
between the read and the write and the code only runs on one cpu.

I assume here that this is related to item 2 'Overlapping loads and
stores within a particular CPU ...' in GUARANTEES of
doc/Documentation/memory-barriers.txt.

Do I miss something?

>>  	rcu_read_unlock();
>>  
>> +	if (rq)
>> +		pr_info("span: %*pbl (max cpu_capacity = %lu)\n",
>> +			cpumask_pr_args(cpu_map), rq->rd->max_cpu_capacity);
>> +
> 
> While a single statement, it is multi line, please add brackets.

OK.

> 
>>  	ret = 0;
>>  error:

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ