All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Anish Moorthy <amoorthy@google.com>
Cc: Shivam Kumar <shivam.kumar1@nutanix.com>,
	maz@kernel.org, pbonzini@redhat.com,  james.morse@arm.com,
	suzuki.poulose@arm.com, oliver.upton@linux.dev,
	 yuzenghui@huawei.com, catalin.marinas@arm.com,
	aravind.retnakaran@nutanix.com,  carl.waldspurger@nutanix.com,
	david.vrabel@nutanix.com, david@redhat.com,  will@kernel.org,
	kvm@vger.kernel.org,  Shaju Abraham <shaju.abraham@nutanix.com>,
	Manish Mishra <manish.mishra@nutanix.com>,
	 Anurag Madnawat <anurag.madnawat@nutanix.com>
Subject: Re: [PATCH v10 1/3] KVM: Implement dirty quota-based throttling of vcpus
Date: Tue, 16 Apr 2024 09:52:18 -0700	[thread overview]
Message-ID: <Zh6swsLAnAE58hQj@google.com> (raw)
In-Reply-To: <CAF7b7mqHWFnZbN5CHvggYYOZepcu9sVzUgNFwi89bLNxgnP_WQ@mail.gmail.com>

On Wed, Feb 21, 2024, Anish Moorthy wrote:
> > @@ -3656,6 +3669,7 @@ void mark_page_dirty(struct kvm *kvm, gfn_t gfn)
> >         struct kvm_memory_slot *memslot;
> >
> >         memslot = gfn_to_memslot(kvm, gfn);
> > +       update_dirty_quota(kvm, PAGE_SIZE);
> >         mark_page_dirty_in_slot(kvm, memslot, gfn);
> >  }
> 
> Is mark_page_dirty() allowed to be used outside of a vCPU context?

It's allowed, but only because we don't have a better option, i.e. it's more
tolerated than allowed. :-)

> The lack of a vcpu* makes me think it is- I assume we don't want to charge
> vCPUs for accesses they're not making.
> 
> Unfortunately we do seem to use it *in* vCPU contexts (see
> kvm_update_stolen_time() on arm64?), although not on x86 AFAICT.

Use what?  mark_page_dirty_in_slot()?  x86 _only_ uses it from vCPU context.

  reply	other threads:[~2024-04-16 16:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-21 19:51 [PATCH v10 0/3] Per-vCPU dirty quota-based throttling Shivam Kumar
2024-02-21 19:51 ` [PATCH v10 1/3] KVM: Implement dirty quota-based throttling of vcpus Shivam Kumar
2024-02-22  2:00   ` Anish Moorthy
2024-04-16 16:52     ` Sean Christopherson [this message]
2024-04-16 16:59   ` Sean Christopherson
2024-04-18 10:36     ` Shivam Kumar
2024-02-21 19:51 ` [PATCH v10 2/3] KVM: x86: Dirty " Shivam Kumar
2024-04-16 17:44   ` Sean Christopherson
2024-02-21 19:51 ` [PATCH v10 3/3] KVM: arm64: " Shivam Kumar
2024-03-21  5:48 ` [PATCH v10 0/3] Per-vCPU dirty quota-based throttling Shivam Kumar
2024-04-04  9:19   ` Marc Zyngier
2024-04-18 10:46     ` Shivam Kumar
2024-04-16 17:44 ` Sean Christopherson
2024-04-18 10:42   ` Shivam Kumar

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=Zh6swsLAnAE58hQj@google.com \
    --to=seanjc@google.com \
    --cc=amoorthy@google.com \
    --cc=anurag.madnawat@nutanix.com \
    --cc=aravind.retnakaran@nutanix.com \
    --cc=carl.waldspurger@nutanix.com \
    --cc=catalin.marinas@arm.com \
    --cc=david.vrabel@nutanix.com \
    --cc=david@redhat.com \
    --cc=james.morse@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=manish.mishra@nutanix.com \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=pbonzini@redhat.com \
    --cc=shaju.abraham@nutanix.com \
    --cc=shivam.kumar1@nutanix.com \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.