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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 9 Dec 2020 10:15:25 -0800
From:   Shakeel Butt <shakeelb@...gle.com>
To:     Michal Hocko <mhocko@...e.com>
Cc:     Hui Su <sh_def@....com>, LKML <linux-kernel@...r.kernel.org>,
        Linux MM <linux-mm@...ck.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] mm/page_alloc: simplify kmem cgroup charge/uncharge code

On Wed, Dec 9, 2020 at 8:29 AM Michal Hocko <mhocko@...e.com> wrote:
>
> On Tue 08-12-20 09:12:23, Shakeel Butt wrote:
> > +Michal Hocko
> >
> > Message starts at https://lkml.kernel.org/r/20201207142204.GA18516@rlk
> >
> > On Mon, Dec 7, 2020 at 10:08 PM Hui Su <sh_def@....com> wrote:
> > >
> > > On Mon, Dec 07, 2020 at 09:28:46AM -0800, Shakeel Butt wrote:
> > > > On Mon, Dec 7, 2020 at 6:22 AM Hui Su <sh_def@....com> wrote:
> > > >
> > > > The reason to keep __memcg_kmem_[un]charge_page functions is that they
> > > > were called in the very hot path. Can you please check the performance
> > > > impact of your change and if the generated code is actually same or
> > > > different.
> > >
> > > Hi, Shakeel:
> > >
> > > I objdump the mm/page_alloc.o and comapre them, it change the assemble code
> > > indeed. In fact, it change some code order, which i personally think won't have
> > > impact on performance. And i ran the ltp mm and conatiner test, it seems nothing
> > > abnormal.
> >
> > Did you run the tests in a memcg? The change is behind a static key of
> > kmem accounting which is enabled for subcontainers.
> >
> > >
> > > BUT i still want to check whether this change will have negative impact on
> > > perforance due to this change code was called in the very hot path like you
> > > said, AND saddly i did not find a way to quantify the impact on performance.
> > > Can you give me some suggestion about how to quantify the performance or some
> > > tool?
> > >
> >
> > At least I think we can try with a simple page allocation in a loop
> > i.e. alloc_page(GFP_KERNEL_ACCOUNT). I will think of any existing
> > benchmark which exercises this code path.
> >
> > Michal, do you have any suggestions?
>
> I have to say I do not see any big benefit from the patch and it alters
> a real hot path to check for the flag even in cases where kmem
> accounting is not enabled, unless I am misreading the code.
>

Yes you are right unless the super intelligent compiler re-arranges
the checks and puts the static key check at front to optimize the
non-kmem-accounting mode.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ