Re: [patch V3 5/8] task isolation: sync vmstats conditional on changes

From: Christoph Lameter
Date: Wed Aug 25 2021 - 05:46:15 EST


On Tue, 24 Aug 2021, Marcelo Tosatti wrote:

> Rather than syncing VM-stats on every return to userspace
> (or VM-entry), keep track of changes through a per-CPU bool.
>
> This improves performance when enabling task isolated
> for vcpu VMs.

And it adds overhead for each time the counters are updated. The static
check is not that bad but the per cpu reference causes an extra cacheline
hit in potentially performance sensitive vm code.

On the other hand: Once we have an indicator that the vmstats have been
updated then the checks for the need to perform a vmstat update can be
simplified using that percpu variable and made much faster.