kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 3 preempted variables in kvm
@ 2021-01-22 15:11 Alex Shi
  2021-01-22 19:30 ` Sean Christopherson
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Shi @ 2021-01-22 15:11 UTC (permalink / raw)
  To: Paolo Bonzini, kvm, Marc Zyngier, yj226063

Hi All,

I am newbie on KVM side, so probably I am wrong on the following.
Please correct me if it is.

There are 3 preempted variables in kvm:
     1, kvm_vcpu.preempted  in include/linux/kvm_host.h
     2, kvm_steal_time.preempted 3, kvm_vcpu_arch.st.preempted in arch/x86
Seems all of them are set or cleared at the same time. Like,

vcpu_put:
        kvm_sched_out()-> set 3 preempted
                kvm_arch_vcpu_put():
                        kvm_steal_time_set_preempted

vcpu_load:
        kvm_sched_in() : clear above 3 preempted
                kvm_arch_vcpu_load() -> kvm_make_request(KVM_REQ_STEAL_UPDATE, vcpu);
                request dealed in vcpu_enter_guest() -> record_steal_time

Except the 2nd one reuse with KVM_FEATURE_PV_TLB_FLUSH bit which could be used
separately, Could we combine them into one, like just bool kvm_vcpu.preempted? and 
move out the KVM_FEATURE_PV_TLB_FLUSH. Believe all arch need this for a vcpu overcommit.

Thanks
Alex

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-26 20:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-22 15:11 3 preempted variables in kvm Alex Shi
2021-01-22 19:30 ` Sean Christopherson
2021-01-25  5:49   ` Alex Shi
2021-01-25  8:46     ` Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).