[PATCH v2 2/2] KVM: arm64: Add memcg accounting to KVM allocations
Oliver Upton
oupton at google.com
Tue Sep 7 15:29:11 PDT 2021
Hi Jia,
On Tue, Sep 7, 2021 at 7:33 AM Jia He <justin.he at arm.com> wrote:
>
> Inspired by commit 254272ce6505 ("kvm: x86: Add memcg accounting to KVM
> allocations"), it would be better to make arm64 KVM consistent with
> common kvm codes.
>
> The memory allocations of VM scope should be charged into VM process
> cgroup, hence change GFP_KERNEL to GFP_KERNEL_ACCOUNT.
>
> There remain a few cases since these allocations are global, not in VM
> scope.
I believe there are more memory allocations that could be switched to
GFP_KERNEL_ACCOUNT. For non-pKVM kernels, we probably should charge
all stage-2 paging structure allocations to the VM process. Your patch
appears to only change the allocation of the kvm_pgtable structure,
but not descendent paging structures.
--
Thanks,
Oliver
More information about the linux-arm-kernel
mailing list