[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6b6acdee-f080-241f-8a6e-89708f746944@oracle.com>
Date: Tue, 19 Nov 2019 14:44:27 +0000
From: Joao Martins <joao.m.martins@...cle.com>
To: Wanpeng Li <kernellwp@...il.com>
Cc: kvm <kvm@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>,
Paolo Bonzini <pbonzini@...hat.com>,
Radim Krčmář <rkrcmar@...hat.com>,
Sean Christopherson <sean.j.christopherson@...el.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Liran Alon <liran.alon@...cle.com>,
Jag Raman <jag.raman@...cle.com>
Subject: Re: [PATCH v2 2/3] KVM: VMX: Do not change PID.NDST when loading a
blocked vCPU
On 11/19/19 11:36 AM, Wanpeng Li wrote:
> On Tue, 12 Nov 2019 at 01:23, Joao Martins <joao.m.martins@...cle.com> wrote:
>>
>> While vCPU is blocked (in kvm_vcpu_block()), it may be preempted which
>> will cause vmx_vcpu_pi_put() to set PID.SN. If later the vCPU will be
>
> How can this happen? See the prepare_to_swait_exlusive() in
> kvm_vcpu_block(), the task will be set in TASK_INTERRUPTIBLE state,
> kvm_sched_out will set vcpu->preempted to true iff current->state ==
> TASK_RUNNING.
You're right.
But preemption (thus setting PID.SN) can still happen before vcpu_block(), or
otherwise scheduled out if we are already in vcpu_block() (with task in
TASK_INTERRUPTIBLE). The right term we should have written in that sentence
above would have been 'scheduled out' and drop the vcpu_block mention and it
would encompass both cases. A better sentence would perhaps be:
"While vCPU is blocked (or about to block) it may be scheduled out which will
cause vmx_vcpu_pi_put() to be called."
But setting or not preempted/PID.SN doesn't change the rest and was mentioned
for completeness.
Joao
Powered by blists - more mailing lists