kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Shi <alex.shi@linux.alibaba.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, Marc Zyngier <maz@kernel.org>,
	yj226063@alibaba-inc.com
Subject: 3 preempted variables in kvm
Date: Fri, 22 Jan 2021 23:11:08 +0800	[thread overview]
Message-ID: <b6398228-31b9-ca84-873b-4febbd37c87d@linux.alibaba.com> (raw)

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

             reply	other threads:[~2021-01-22 15:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22 15:11 Alex Shi [this message]
2021-01-22 19:30 ` 3 preempted variables in kvm Sean Christopherson
2021-01-25  5:49   ` Alex Shi
2021-01-25  8:46     ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b6398228-31b9-ca84-873b-4febbd37c87d@linux.alibaba.com \
    --to=alex.shi@linux.alibaba.com \
    --cc=kvm@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=yj226063@alibaba-inc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).