Re: [PATCH] KVM: arm64: Remove redundant check for S2FWB

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

 



Hi Marc,

Thanks for the comment.
On Fri, Feb 5, 2021 at 11:24 AM Marc Zyngier <maz@xxxxxxxxxx> wrote:
>
> Hi Jing,
>
> On 2021-02-05 04:44, Jing Zhang wrote:
> > Remove redundant check for CPU feature S2FWB in dcache flush code
> > to save some CPU cycles for every memslot flush and unmapping.
>
> What CPU cycles? This is only a static branch. Can you actually
> measure the overhead? What does it represent in the face of
> a full memslot unmapping?
For CPU cycles, I mean CPU time spent for S2FWB check.
For memslot unmapping, there is actually no improvement, just move the
check to the stage2_unmap_walker since we removed the S2FWB check in
stage2_flush_dcache.
The saving is from the code path of memslot flush. The S2FWB check was
in stage2_flush_dcache, in which case, for a memslot flush, the check
was done for every page. Now it will save some CPU time if we do the
check at a higher level, like in kvm_toggle_cache, access_dcsw,
kvm_arch_prepare_memory_region.
The redundant check is as follows (Only the first check is necessary):
kvm_arch_prepare_memory_region -> S2FWB check -> stage2_flush_memslot
-> kvm_pgtable_stage2_flush -> S2FWB check -> stage2_flush_walker ->
S2FWB check -> __flush_dcache_area

>
> Thanks,
>
>          M.
> --
> Jazz is not dead. It just smells funny...
_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm



[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux