All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Upton <oupton@google.com>
To: Jia He <justin.he@arm.com>
Cc: Marc Zyngier <maz@kernel.org>, James Morse <james.morse@arm.com>,
	Alexandru Elisei <Alexandru.Elisei@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Xiaoming Ni <nixiaoming@huawei.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Kees Cook <keescook@chromium.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	linux-kernel@vger.kernel.org, Liu Shixin <liushixin2@huawei.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Will Deacon <will@kernel.org>,
	kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 2/2] KVM: arm64: Add memcg accounting to KVM allocations
Date: Tue, 7 Sep 2021 17:29:11 -0500	[thread overview]
Message-ID: <CAOQ_QsjOmHw+545J0T9i-nWV2bVGGEwHq5SPVvBOM-SHMXpP5g@mail.gmail.com> (raw)
In-Reply-To: <20210907123112.10232-3-justin.he@arm.com>

Hi Jia,

On Tue, Sep 7, 2021 at 7:33 AM Jia He <justin.he@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

WARNING: multiple messages have this Message-ID (diff)
From: Oliver Upton <oupton@google.com>
To: Jia He <justin.he@arm.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Kees Cook <keescook@chromium.org>, Will Deacon <will@kernel.org>,
	Marc Zyngier <maz@kernel.org>,
	linux-kernel@vger.kernel.org, Liu Shixin <liushixin2@huawei.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Xiaoming Ni <nixiaoming@huawei.com>,
	kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 2/2] KVM: arm64: Add memcg accounting to KVM allocations
Date: Tue, 7 Sep 2021 17:29:11 -0500	[thread overview]
Message-ID: <CAOQ_QsjOmHw+545J0T9i-nWV2bVGGEwHq5SPVvBOM-SHMXpP5g@mail.gmail.com> (raw)
In-Reply-To: <20210907123112.10232-3-justin.he@arm.com>

Hi Jia,

On Tue, Sep 7, 2021 at 7:33 AM Jia He <justin.he@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
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Oliver Upton <oupton@google.com>
To: Jia He <justin.he@arm.com>
Cc: Marc Zyngier <maz@kernel.org>, James Morse <james.morse@arm.com>,
	 Alexandru Elisei <Alexandru.Elisei@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	 Xiaoming Ni <nixiaoming@huawei.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	 Kees Cook <keescook@chromium.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	 Nick Desaulniers <ndesaulniers@google.com>,
	linux-kernel@vger.kernel.org,  Liu Shixin <liushixin2@huawei.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	 Will Deacon <will@kernel.org>,
	kvmarm@lists.cs.columbia.edu,
	 linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 2/2] KVM: arm64: Add memcg accounting to KVM allocations
Date: Tue, 7 Sep 2021 17:29:11 -0500	[thread overview]
Message-ID: <CAOQ_QsjOmHw+545J0T9i-nWV2bVGGEwHq5SPVvBOM-SHMXpP5g@mail.gmail.com> (raw)
In-Reply-To: <20210907123112.10232-3-justin.he@arm.com>

Hi Jia,

On Tue, Sep 7, 2021 at 7:33 AM Jia He <justin.he@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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-09-07 22:29 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07 12:31 [PATCH v2 0/2] Add memcg accounting to Arm KVM Jia He
2021-09-07 12:31 ` Jia He
2021-09-07 12:31 ` Jia He
2021-09-07 12:31 ` [PATCH v2 1/2] KVM: arm64: vgic: Add memcg accounting to vgic allocations Jia He
2021-09-07 12:31   ` Jia He
2021-09-07 12:31   ` Jia He
2021-09-08  1:21   ` Oliver Upton
2021-09-08  1:21     ` Oliver Upton
2021-09-08  1:21     ` Oliver Upton
2021-09-07 12:31 ` [PATCH v2 2/2] KVM: arm64: Add memcg accounting to KVM allocations Jia He
2021-09-07 12:31   ` Jia He
2021-09-07 12:31   ` Jia He
2021-09-07 22:29   ` Oliver Upton [this message]
2021-09-07 22:29     ` Oliver Upton
2021-09-07 22:29     ` Oliver Upton
2021-09-09 12:56     ` Justin He
2021-09-09 12:56       ` Justin He
2021-09-09 12:56       ` Justin He
2021-09-13 12:21       ` Oliver Upton
2021-09-13 12:21         ` Oliver Upton
2021-09-13 12:21         ` Oliver Upton
2021-10-13  9:01         ` Justin He
2021-10-13  9:01           ` Justin He
2021-10-13  9:01           ` Justin He
2021-10-17 10:30 ` [PATCH v2 0/2] Add memcg accounting to Arm KVM Marc Zyngier
2021-10-17 10:30   ` Marc Zyngier
2021-10-17 10:30   ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOQ_QsjOmHw+545J0T9i-nWV2bVGGEwHq5SPVvBOM-SHMXpP5g@mail.gmail.com \
    --to=oupton@google.com \
    --cc=Alexandru.Elisei@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=justin.he@arm.com \
    --cc=keescook@chromium.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liushixin2@huawei.com \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=maz@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nixiaoming@huawei.com \
    --cc=samitolvanen@google.com \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.