From: Marc Zyngier <maz@kernel.org>
To: Shivam Kumar <shivam.kumar1@nutanix.com>
Cc: Sean Christopherson <seanjc@google.com>,
pbonzini@redhat.com, james.morse@arm.com,
borntraeger@linux.ibm.com, david@redhat.com, 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 v7 1/4] KVM: Implement dirty quota-based throttling of vcpus
Date: Sun, 15 Jan 2023 19:13:51 +0000 [thread overview]
Message-ID: <865yd7obkg.wl-maz@kernel.org> (raw)
In-Reply-To: <6cb4eb85-bfaa-10cd-5625-94605a5565f5@nutanix.com>
On Sun, 15 Jan 2023 14:50:55 +0000,
Shivam Kumar <shivam.kumar1@nutanix.com> wrote:
>
> >> Thank you Marc for the suggestion. We can make dirty quota count
> >> dirtied memory rather than faults.
> >>
> >> run->dirty_quota -= page_size;
> >>
> >> We can raise a kvm request for exiting to userspace as soon as the
> >> dirty quota of the vcpu becomes zero or negative. Please let me know
> >> if this looks good to you.
> >
> > It really depends what "page_size" represents here. If you mean
> > "mapping size", then yes. If you really mean "page size", then no.
> >
> > Assuming this is indeed "mapping size", then it all depends on how
> > this is integrated and how this is managed in a generic, cross
> > architecture way.
> >
> > Thanks,
> >
> > M.
> >
>
> Yes, it is "mapping size". I can see that there's a "npages" variable
> in "kvm_memory_slot" which determines the number of bits we need to
> track dirtying for a given memory slot. And this variable is computed
> by right shifting the memory size by PAGE_SHIFT. Each arch defines the
> macro PAGE_SHIFT, and another macro PAGE_SIZE as the left shift of 1
> by PAGE_SHIFT. Does it make sense to use this macro?
I don't think it makes any sense.
There is nothing in the memslot structure that you can make use of.
The information you need is the page table structure itself (the
level, precisely), which tells you how big the mapping is for this
particular part of the memslot.
This is dynamic information, not defined at memslot creation. Which is
why it can only be captured at fault time (with the exception of
HugeTLBFS backed memslots for which the mapping size is cast into
stone).
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2023-01-15 19:14 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-13 17:05 [PATCH v7 0/4] KVM: Dirty quota-based throttling Shivam Kumar
2022-11-13 17:05 ` [PATCH v7 1/4] KVM: Implement dirty quota-based throttling of vcpus Shivam Kumar
2022-11-14 23:29 ` Yunhong Jiang
2022-11-15 4:48 ` Shivam Kumar
2022-11-17 19:26 ` Marc Zyngier
2022-11-18 9:47 ` Shivam Kumar
2022-11-22 17:46 ` Marc Zyngier
2022-12-06 6:22 ` Shivam Kumar
2022-12-07 16:44 ` Marc Zyngier
2022-12-07 19:53 ` Sean Christopherson
2022-12-08 7:30 ` Shivam Kumar
2022-12-25 16:50 ` Shivam Kumar
2022-12-26 10:07 ` Marc Zyngier
2023-01-07 17:24 ` Shivam Kumar
2023-01-07 21:44 ` Marc Zyngier
2023-01-14 13:07 ` Shivam Kumar
2023-01-15 9:56 ` Marc Zyngier
2023-01-15 14:50 ` Shivam Kumar
2023-01-15 19:13 ` Marc Zyngier [this message]
2023-01-29 22:00 ` Shivam Kumar
2023-02-11 6:52 ` Shivam Kumar
2023-02-12 17:09 ` Marc Zyngier
2023-02-12 17:54 ` Shivam Kumar
2023-02-12 18:02 ` Marc Zyngier
2023-02-12 17:56 ` Shivam Kumar
2022-12-08 7:20 ` Shivam Kumar
2022-11-25 10:52 ` kernel test robot
2022-11-13 17:05 ` [PATCH v7 2/4] KVM: x86: Dirty " Shivam Kumar
2022-11-15 0:16 ` Yunhong Jiang
2022-11-15 4:55 ` Shivam Kumar
2022-11-15 6:45 ` Yunhong Jiang
2022-11-18 8:51 ` Shivam Kumar
2022-11-13 17:05 ` [PATCH v7 3/4] KVM: arm64: " Shivam Kumar
2022-11-15 0:27 ` Yunhong Jiang
2022-11-15 5:10 ` Shivam Kumar
2022-11-17 20:44 ` Marc Zyngier
2022-11-18 8:56 ` Shivam Kumar
2022-11-13 17:05 ` [PATCH v7 4/4] KVM: selftests: Add selftests for dirty quota throttling 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=865yd7obkg.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=anurag.madnawat@nutanix.com \
--cc=borntraeger@linux.ibm.com \
--cc=david@redhat.com \
--cc=james.morse@arm.com \
--cc=kvm@vger.kernel.org \
--cc=manish.mishra@nutanix.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=shaju.abraham@nutanix.com \
--cc=shivam.kumar1@nutanix.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.