Re: [PATCH v5 5/9] mm: list_lru: deduplicate lock_list_lru()
From: Wei Yang
Date: Fri May 29 2026 - 05:57:16 EST
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?
Also the name in callsite and the argument annotation. Would it be cleaner
readers?
--
Wei Yang
Help you, Help me