lkml.org 
[lkml]   [2016]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] locking/osq: Drop the overload of osq lock
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.

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

\
 
 \ /
  Last update: 2016-06-25 19:01    [W:0.228 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site