]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: Use mask of harvested dirty ring entries to coalesce dirty ring resets
authorSean Christopherson <seanjc@google.com>
Fri, 16 May 2025 21:35:39 +0000 (14:35 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 20 Jun 2025 20:41:03 +0000 (13:41 -0700)
commite46ad851150f1dd14b8542b6fb7a51f695a99eb1
tree2a87fa8efd86535546003a7bb54bd273e59a8098
parentee188dea1677a0d9b3a8097e71b803896b8aaed7
KVM: Use mask of harvested dirty ring entries to coalesce dirty ring resets

Use "mask" instead of a dedicated boolean to track whether or not there
is at least one to-be-reset entry for the current slot+offset.  In the
body of the loop, mask is zero only on the first iteration, i.e. !mask is
equivalent to first_round.

Opportunistically combine the adjacent "if (mask)" statements into a single
if-statement.

No functional change intended.

Cc: Peter Xu <peterx@redhat.com>
Cc: Yan Zhao <yan.y.zhao@intel.com>
Cc: Maxim Levitsky <mlevitsk@redhat.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@amd.com>
Reviewed-by: James Houghton <jthoughton@google.com>
Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com>
Reviewed-by: Yan Zhao <yan.y.zhao@intel.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/r/20250516213540.2546077-6-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
virt/kvm/dirty_ring.c