Re: [PATCH] KVM: arm64: Limit stage2_apply_range() batch size to smallest block

From: Ali Saidi
Date: Thu Apr 04 2024 - 17:30:05 EST


I measured the time it takes to unmap a VM by changing the kvm_page_table_test
to report it. It's and on Graviton3 it's about 300ms per 1GB of flushing
with 4KB pages. Unmapping 128GB takes around 39.5s and with a single call to
__kvm_tlb_flush_vmid() instead of the 32M calls to __kvm_tlb_flush_vmid_ipa()
reduces this to around 5.9s (~7x). This means each iteration of the
stage2_apply_range() is reduced to 46ms. So we're certainly calling
cond_resched() a whole lot more.


> Just a quick followup that I did test Will's patches and didn't find
> that it changed the performance of the workload that I'd been testing.
> IOW, I wasn't able to discern a network performance difference between
> the baseline and those changes.

That is a bit unexpected that the performance wasn't worse with the patch Will
sent because it should have disabled the range invalidates since they these
invalidates will be getting rid of blocks? Which Graviton were you testing
this on?

Ali