Re: [PATCH v2 7/7] mm: switch deferred split shrinker to list_lru
From: David Hildenbrand (Arm)
Date: Mon Mar 23 2026 - 15:32:16 EST
On 3/20/26 17:07, Johannes Weiner wrote:
> On Thu, Mar 19, 2026 at 08:21:21AM +0100, David Hildenbrand (Arm) wrote:
>> Of course :) If list_lru lock helpers would be the right thing to do, it
>> might be better placed in this series.
>
> I think this is slightly more promising. See below. The callsites in
> huge_memory.c look nicer. But the double folio_nid() and folio_memcg()
> lookups (when the caller needs them too) are kind of unfortunate; and
> it feels like a lot of API for 4 callsites. Thoughts?
I like that. Could we just put the implementation inline into
list_lru.h, such that the compiler could try reusing nid+memcg?
[...]
> __list_lru_add(&deferred_split_lru, l,
> &folio->_deferred_list,
> folio_nid(folio), folio_memcg(folio));
> - list_lru_unlock_irqrestore(l, &flags);
> - rcu_read_unlock();
> + folio_list_lru_unlock_irqrestore(folio, l, &flags);
I guess it would look even cleaner if we would wrap the __list_lru_add()
that needs the memcg + nid in an own helper.
These are the only remaining users of memcg+nid, right?
--
Cheers,
David