lkml.org 
[lkml]   [2021]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 01/17] mm: list_lru: optimize memory consumption of arrays of per cgroup lists
On Tue, Dec 14, 2021 at 12:53:26AM +0800, Muchun Song wrote:
> The list_lru uses an array (list_lru_memcg->lru) to store pointers
> which point to the list_lru_one. And the array is per memcg per node.
> Therefore, the size of the arrays will be 10K * number_of_node * 8 (
> a pointer size on 64 bits system) when we run 10k containers in the
> system. The memory consumption of the arrays becomes significant. The
> more numa node, the more memory it consumes.

The complexity for the lists themselves is still nrmemcgs * nrnodes
right? But the rcu_head goes from that to nrmemcgs.

> I have done a simple test, which creates 10K memcg and mount point
> each in a two-node system. The memory consumption of the list_lru
> will be 24464MB. After converting the array from per memcg per node
> to per memcg, the memory consumption is going to be 21957MB. It is
> reduces by 2.5GB. In our AMD servers, there are 8 numa nodes in
> those system, the memory consumption could be more significant.

The code looks good to me, but it would be useful to include a
high-level overview of the new scheme, explain that the savings come
from the rcu heads, that it simplifies the alloc/dealloc path etc.

With that,

> Signed-off-by: Muchun Song <songmuchun@bytedance.com>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

\
 
 \ /
  Last update: 2021-12-14 14:39    [W:0.191 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site