[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210501032749.GQ1847222@casper.infradead.org>
Date: Sat, 1 May 2021 04:27:49 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Muchun Song <songmuchun@...edance.com>
Cc: Dave Chinner <david@...morbit.com>, Roman Gushchin <guro@...com>,
Andrew Morton <akpm@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>,
Vladimir Davydov <vdavydov.dev@...il.com>,
Shakeel Butt <shakeelb@...gle.com>,
Yang Shi <shy828301@...il.com>, alexs@...nel.org,
Alexander Duyck <alexander.h.duyck@...ux.intel.com>,
Wei Yang <richard.weiyang@...il.com>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Linux Memory Management List <linux-mm@...ck.org>
Subject: Re: [External] Re: [PATCH 0/9] Shrink the list lru size on memory
cgroup removal
On Fri, Apr 30, 2021 at 04:32:39PM +0800, Muchun Song wrote:
> Before start, we should know about the following rules of list lrus.
>
> - Only objects allocated with __GFP_ACCOUNT need to allocate
> the struct list_lru_node.
> - The caller of allocating memory must know which list_lru the
> object will insert.
>
> So we can allocate struct list_lru_node when allocating the
> object instead of allocating it when list_lru_add(). It is easy, because
> we already know the list_lru and memcg which the object belongs
> to. So we can introduce a new helper to allocate the object and
> list_lru_node. Like below.
I feel like there may be a simpler solution, although I'm not really
familiar with the list_lru situation. The three caches you mention:
> I have looked at the code closely. There are 3 different kmem_caches that
> need to use this new API to allocate memory. They are inode_cachep,
> dentry_cache and radix_tree_node_cachep. I think that it is easy to migrate.
are all filesystem. So if there's a way of knowing which filesystems
are exposed to each container, we can allocate the list_lru structures at
"mount" time rather than at first allocation for a given cache/lru/memcg
combination.
Powered by blists - more mailing lists