Re: [PATCH v7 1/4] KVM: Implement dirty quota-based throttling of vcpus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 15/01/23 3:26 pm, Marc Zyngier wrote:
On Sat, 14 Jan 2023 13:07:44 +0000,
Shivam Kumar <shivam.kumar1@xxxxxxxxxxx> wrote:



On 08/01/23 3:14 am, Marc Zyngier wrote:
On Sat, 07 Jan 2023 17:24:24 +0000,
Shivam Kumar <shivam.kumar1@xxxxxxxxxxx> wrote:
On 26/12/22 3:37 pm, Marc Zyngier wrote:
On Sun, 25 Dec 2022 16:50:04 +0000,
Shivam Kumar <shivam.kumar1@xxxxxxxxxxx> 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.


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?

Thanks, again, Marc.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux