[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YK5ed8ixweIAsvlL@hirez.programming.kicks-ass.net>
Date: Wed, 26 May 2021 16:43:03 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Masanori Misono <m.misono760@...il.com>
Cc: David Woodhouse <dwmw@...zon.co.uk>,
Paolo Bonzini <pbonzini@...hat.com>,
Rohit Jain <rohit.k.jain@...cle.com>,
Ingo Molnar <mingo@...hat.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC 0/1] Make vCPUs that are HLT state candidates for
load balancing
On Wed, May 26, 2021 at 10:37:26PM +0900, Masanori Misono wrote:
> is_vcpu_preempted() is also used in PV spinlock implementations to mitigate
> lock holder preemption problems,
It's used to abort optimistic spinners.
> etc. A vCPU holding a lock does not do HLT,
Optimistic spinning is actually part of mutexes and rwsems too, and in
those cases we might very well end up in idle while holding the lock.
However; in that case the task will have been scheduled out and the
optimistic spin loop will terminate due to that (see the ->on_cpu
condition).
> so I think this patch doesn't affect them.
That is correct.
> However, pCPU may be
> running the host's thread that has higher priority than a vCPU thread, and
> in that case, is_vcpu_preempted() should return 0 ideally.
No, in that case vcpu_is_preempted() really should return true. There is
no saying how long the vcpu is gone for.
Powered by blists - more mailing lists