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:	Sun, 26 Jun 2016 01:27:56 +0800
From:	panxinhui <xinhui@...ux.vnet.ibm.com>
To:	Boqun Feng <boqun.feng@...il.com>
Cc:	panxinhui <xinhui@...ux.vnet.ibm.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Pan Xinhui <xinhui.pan@...ux.vnet.ibm.com>,
	linux-kernel@...r.kernel.org, mingo@...hat.com, dave@...olabs.net,
	will.deacon@....com, Waiman.Long@....com, benh@...nel.crashing.org
Subject: Re: [PATCH] locking/osq: Drop the overload of osq lock


> 在 2016年6月26日,00:45,Boqun Feng <boqun.feng@...il.com> 写道:
> 
> On Sat, Jun 25, 2016 at 06:15:40PM +0200, Peter Zijlstra wrote:
>> On Sat, Jun 25, 2016 at 11:21:30PM +0800, Boqun Feng wrote:
>>> So on PPC, we have lppaca::yield_count to detect when an vcpu is
>>> preempted, if the yield_count is even, the vcpu is running, otherwise it
>>> is preempted(__spin_yield() is a user of this).
>>> 
>>> Therefore it makes more sense we
>>> 
>>> 		if (need_resched() || vcpu_is_preempted(old))
>>> 
>>> here, and implement vcpu_is_preempted() on PPC as
>>> 
>>> bool vcpu_is_preempted(int cpu)
>>> {
>>> 	return !!(be32_to_cpu(lppaca_of(cpu).yield_count) & 1)
>>> }
>>> 
>>> Thoughts?
>> 
>> Would that not have issues where the owner cpu is kept running but the
>> spinner (ie. _this_ vcpu) gets preempted? I would think that in that
>> case we too want to stop spinning.
>> 
> 
do  you mean that the spinner detect itself had yield out during the big spin loop?

It is very possible to happen.  BUT if spinner(on this vcpu) yield out, the next spinner would break the spin loop.
AND if spinner detect itself yield out once, it’s very possible to get the osq lock soon as long as the ower vcpu is running.

SO I think we need just check the owner vcpu’s yield_count.

> I don't think we want(or need) to stop the spinning of _this_ vcpu in
> that case? Because it has already been preempted, when it gets back to
> run, the owner may still be running and haven't set ->locked to 1 yet,
> which means spinning on this vcpu is still worthwhile.
> 

> I think the proper logic here is that in the optimistic spin queue, if
> any one found its predecessor's vcpu was preempted, it should stop
> spinning, because it's very likely that it would not see ->locked
> becoming 1 in a short time.
> 
agree!!!
this  vcpu need yield out too if the owner’s vcpu has yield out.


>> Although, if all vcpus are scheduled equal, it might not matter on
>> average.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ