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 09:56:36 +0000 [thread overview]
Message-ID: <87h6wsdstn.wl-maz@kernel.org> (raw)
In-Reply-To: <4df8b276-595f-1ad7-4ce5-62435ea93032@nutanix.com>
On Sat, 14 Jan 2023 13:07:44 +0000,
Shivam Kumar <shivam.kumar1@nutanix.com> wrote:
>
>
>
> On 08/01/23 3:14 am, Marc Zyngier wrote:
> > On Sat, 07 Jan 2023 17:24:24 +0000,
> > Shivam Kumar <shivam.kumar1@nutanix.com> wrote:
> >> On 26/12/22 3:37 pm, Marc Zyngier wrote:
> >>> On Sun, 25 Dec 2022 16:50:04 +0000,
> >>> Shivam Kumar <shivam.kumar1@nutanix.com> wrote:
> >>>>
> >>>> Hi Marc,
> >>>> Hi Sean,
> >>>>
> >>>> Please let me know if there's any further question or feedback.
> >>>
> >>> My earlier comments still stand: the proposed API is not usable as a
> >>> general purpose memory-tracking API because it counts faults instead
> >>> of memory, making it inadequate except for the most trivial cases.
> >>> And I cannot believe you were serious when you mentioned that you were
> >>> happy to make that the API.
> >>>
> >>> This requires some serious work, and this series is not yet near a
> >>> state where it could be merged.
> >>>
> >>> Thanks,
> >>>
> >>> M.
> >>>
> >>
> >> Hi Marc,
> >>
> >> IIUC, in the dirty ring interface too, the dirty_index variable is
> >> incremented in the mark_page_dirty_in_slot function and it is also
> >> count-based. At least on x86, I am aware that for dirty tracking we
> >> have uniform granularity as huge pages (2MB pages) too are broken into
> >> 4K pages and bitmap is at 4K-granularity. Please let me know if it is
> >> possible to have multiple page sizes even during dirty logging on
> >> ARM. And if that is the case, I am wondering how we handle the bitmap
> >> with different page sizes on ARM.
> >
> > Easy. It *is* page-size, by the very definition of the API which
> > explicitly says that a single bit represent one basic page. If you
> > were to only break 1GB mappings into 2MB blocks, you'd have to mask
> > 512 pages dirty at once, no question asked.
> >
> > Your API is different because at no point it implies any relationship
> > with any page size. As it stands, it is a useless API. I understand
> > that you are only concerned with your particular use case, but that's
> > nowhere good enough. And it has nothing to do with ARM. This is
> > equally broken on *any* architecture.
> >
> >> I agree that the notion of pages dirtied according to our
> >> pages_dirtied variable depends on how we are handling the bitmap but
> >> we expect the userspace to use the same granularity at which the dirty
> >> bitmap is handled. I can capture this in documentation
> >
> > But what does the bitmap have to do with any of this? This is not what
> > your API is about. You are supposed to count dirtied memory, and you
> > are counting page faults instead. No sane userspace can make any sense
> > of that. You keep coupling the two, but that's wrong. This thing has
> > to be useful on its own, not just for your particular, super narrow
> > use case. And that's a shame because the general idea of a dirty quota
> > is an interesting one.
> >
> > If your sole intention is to capture in the documentation that the API
> > is broken, then all I can do is to NAK the whole thing. Until you turn
> > this page-fault quota into the dirty memory quota that you advertise,
> > I'll continue to say no to it.
> >
> > Thanks,
> >
> > M.
> >
>
> 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.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2023-01-15 9:57 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 [this message]
2023-01-15 14:50 ` Shivam Kumar
2023-01-15 19:13 ` Marc Zyngier
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=87h6wsdstn.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.