lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOQ_QshF+N7Q=-cXAoMSW4Gcy7mr_oFVpye7fEBqPeR8+3mK0Q@mail.gmail.com>
Date:   Mon, 13 Sep 2021 08:21:12 -0400
From:   Oliver Upton <oupton@...gle.com>
To:     Justin He <justin.he@....com>
Cc:     Marc Zyngier <maz@...nel.org>, James Morse <james.morse@....com>,
        Alexandru Elisei <Alexandru.Elisei@....com>,
        Suzuki Poulose <suzuki.poulose@....com>,
        Xiaoming Ni <nixiaoming@...wei.com>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Kees Cook <keescook@...omium.org>,
        Catalin Marinas <catalin.marinas@....com>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Liu Shixin <liushixin2@...wei.com>,
        Sami Tolvanen <samitolvanen@...gle.com>,
        Will Deacon <will@...nel.org>,
        "kvmarm@...ts.cs.columbia.edu" <kvmarm@...ts.cs.columbia.edu>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v2 2/2] KVM: arm64: Add memcg accounting to KVM allocations

Justin,

On Thu, Sep 9, 2021 at 8:57 AM Justin He <Justin.He@....com> wrote:
>
> Hi Oliver, thanks for the review, please my comments below:
>
> > -----Original Message-----
> > From: Oliver Upton <oupton@...gle.com>
> > Sent: Wednesday, September 8, 2021 6:29 AM
> > To: Justin He <Justin.He@....com>
> > Cc: Marc Zyngier <maz@...nel.org>; James Morse <James.Morse@....com>;
> > Alexandru Elisei <Alexandru.Elisei@....com>; Suzuki Poulose
> > <Suzuki.Poulose@....com>; Xiaoming Ni <nixiaoming@...wei.com>; Lorenzo
> > Pieralisi <Lorenzo.Pieralisi@....com>; Kees Cook <keescook@...omium.org>;
> > Catalin Marinas <Catalin.Marinas@....com>; Nick Desaulniers
> > <ndesaulniers@...gle.com>; linux-kernel@...r.kernel.org; Liu Shixin
> > <liushixin2@...wei.com>; Sami Tolvanen <samitolvanen@...gle.com>; Will
> > Deacon <will@...nel.org>; kvmarm@...ts.cs.columbia.edu; linux-arm-
> > kernel@...ts.infradead.org
> > Subject: Re: [PATCH v2 2/2] KVM: arm64: Add memcg accounting to KVM
> > allocations
> >
> > Hi Jia,
> >
> > On Tue, Sep 7, 2021 at 7:33 AM Jia He <justin.he@....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.
> >
> Do you mean kvm_hyp_zalloc_page() here?
> Seems kvm_hyp_zalloc_page() is in both global and VM scopes.

Doh! kvm_hyp_zalloc_page() is only for the hyp's page tables, hence I
believe your patch is correct as it stands. As such:

Reviewed-by: Oliver Upton <oupton@...gle.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ