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]
Message-ID: <7ia4semfzhrx.fsf@castle.c.googlers.com>
Date: Fri, 11 Apr 2025 00:03:14 +0000
From: Roman Gushchin <roman.gushchin@...ux.dev>
To: Shakeel Butt <shakeel.butt@...ux.dev>
Cc: Andrew Morton <akpm@...ux-foundation.org>,  Johannes Weiner
 <hannes@...xchg.org>,  Michal Hocko <mhocko@...nel.org>,  Muchun Song
 <muchun.song@...ux.dev>,  Yosry Ahmed <yosry.ahmed@...ux.dev>,  Waiman
 Long <llong@...hat.com>,  linux-mm@...ck.org,  cgroups@...r.kernel.org,
  linux-kernel@...r.kernel.org,  Meta kernel team <kernel-team@...a.com>
Subject: Re: [PATCH v2] memcg: optimize memcg_rstat_updated

Shakeel Butt <shakeel.butt@...ux.dev> writes:

> Currently the kernel maintains the stats updates per-memcg which is
> needed to implement stats flushing threshold. On the update side, the
> update is added to the per-cpu per-memcg update of the given memcg and
> all of its ancestors. However when the given memcg has passed the
> flushing threshold, all of its ancestors should have passed the
> threshold as well. There is no need to traverse up the memcg tree to
> maintain the stats updates.
>
> Perf profile collected from our fleet shows that memcg_rstat_updated is
> one of the most expensive memcg function i.e. a lot of cumulative CPU
> is being spent on it. So, even small micro optimizations matter a lot.
> This patch is microbenchmarked with multiple instances of netperf on a
> single machine with locally running netserver and we see couple of
> percentage of improvement.
>
> Signed-off-by: Shakeel Butt <shakeel.butt@...ux.dev>

Acked-by: Roman Gushchin <roman.gushchin@...ux.dev>

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ