On 31/03/22 6:10 am, Sean Christopherson wrote:
On Sun, Mar 06, 2022, Shivam Kumar wrote:
Update the kvm_run structure with a brief description of dirty
quota members and how dirty quota throttling works.
This should be squashed with patch 1. I actually had to look ahead to this patch
because I forgot the details since I last reviewed this :-)
Ack. Thanks.
+ __u64 dirty_quota;
+Please note that this quota cannot be strictly enforced if PML is enabled, and
+the VCPU may end up dirtying pages more than its quota. The difference however
+is bounded by the PML buffer size.
If you want to be pedantic, I doubt KVM can strictly enforce the quota even if PML
is disabled. E.g. I can all but guarantee that it's possible to dirty multiple
pages during a single exit. Probably also worth spelling out PML and genericizing
things. Maybe
Please note that enforcing the quota is best effort, as the guest may dirty
multiple pages before KVM can recheck the quota. However, unless KVM is using
a hardware-based dirty ring buffer, e.g. Intel's Page Modification Logging,
KVM will detect quota exhaustion within a handful of dirtied page. If a
hardware ring buffer is used, the overrun is bounded by the size of the buffer
(512 entries for PML).
Thank you for the blurb. Looks good to me, though I'm curious about the
exits
that can dirty multiple pages.
Thank you so much for the review, Sean. I'm hoping if I could get
one-pass review
from you on the third patch in this series (selftests for dirty quota).