Re: [PATCH v5 5/9] mm: list_lru: deduplicate lock_list_lru()
From: Johannes Weiner
Date: Fri May 29 2026 - 09:47:29 EST
On Fri, May 29, 2026 at 09:56:28AM +0000, Wei Yang wrote:
> On Wed, May 27, 2026 at 04:45:12PM -0400, Johannes Weiner wrote:
> >The MEMCG and !MEMCG paths have the same pattern. Share the code.
> >
> >Reviewed-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
> >Acked-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>
> >Reviewed-by: Lorenzo Stoakes (Oracle) <ljs@xxxxxxxxxx>
> >Signed-off-by: Johannes Weiner <hannes@xxxxxxxxxxx>
> >Reviewed-by: Liam R. Howlett (Oracle) <liam@xxxxxxxxxxxxx>
> >---
> > mm/list_lru.c | 21 +++++++++------------
> > 1 file changed, 9 insertions(+), 12 deletions(-)
> >
> >diff --git a/mm/list_lru.c b/mm/list_lru.c
> >index 7d0523e44010..fdb3fe2ea64f 100644
> >--- a/mm/list_lru.c
> >+++ b/mm/list_lru.c
> >@@ -15,6 +15,14 @@
> > #include "slab.h"
> > #include "internal.h"
>
> Hi, Johannes
>
> One very tiny nit below.
>
> >
> >+static inline void lock_list_lru(struct list_lru_one *l, bool irq)
>
> Here we use @irq.
>
> >+{
> >+ if (irq)
> >+ spin_lock_irq(&l->lock);
> >+ else
> >+ spin_lock(&l->lock);
> >+}
> >+
> > static inline void unlock_list_lru(struct list_lru_one *l, bool irq_off)
>
> Here we use @irq_off.
>
> Do you think it would be nicer to unify the parameter name?
Yes, I think it would be nicer.
Note that I inherited this - we had irq on the lock and irq_off on the
unlock before already. I didn't want to mix even more yak shaving prep
patches into this series.
Mind sending a follow-up patch on top of mm-unstable?