linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] mm: simplify list initialization in barn_shrink()
@ 2025-11-11 12:22 Baolin Liu
  2025-11-13  8:37 ` Harry Yoo
  0 siblings, 1 reply; 3+ messages in thread
From: Baolin Liu @ 2025-11-11 12:22 UTC (permalink / raw)
  To: vbabka, akpm, cl, rientjes, roman.gushchin, harry.yoo
  Cc: linux-mm, linux-kernel, Baolin Liu

From: Baolin Liu <liubaolin@kylinos.cn>

In barn_shrink(),use LIST_HEAD() to declare and initialize
the list_head in one step instead of using INIT_LIST_HEAD() separately.

No functional change.

Signed-off-by: Baolin Liu <liubaolin@kylinos.cn>
---
 mm/slub.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index f1a5373eee7b..0ab5d87305af 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3011,14 +3011,11 @@ static void barn_init(struct node_barn *barn)
 
 static void barn_shrink(struct kmem_cache *s, struct node_barn *barn)
 {
-	struct list_head empty_list;
-	struct list_head full_list;
+	LIST_HEAD(empty_list);
+	LIST_HEAD(full_list);
 	struct slab_sheaf *sheaf, *sheaf2;
 	unsigned long flags;
 
-	INIT_LIST_HEAD(&empty_list);
-	INIT_LIST_HEAD(&full_list);
-
 	spin_lock_irqsave(&barn->lock, flags);
 
 	list_splice_init(&barn->sheaves_full, &full_list);
-- 
2.39.2



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] mm: simplify list initialization in barn_shrink()
  2025-11-11 12:22 [PATCH v1] mm: simplify list initialization in barn_shrink() Baolin Liu
@ 2025-11-13  8:37 ` Harry Yoo
  2025-11-13  9:33   ` Vlastimil Babka
  0 siblings, 1 reply; 3+ messages in thread
From: Harry Yoo @ 2025-11-13  8:37 UTC (permalink / raw)
  To: Baolin Liu
  Cc: vbabka, akpm, cl, rientjes, roman.gushchin, linux-mm,
	linux-kernel, Baolin Liu

On Tue, Nov 11, 2025 at 08:22:05PM +0800, Baolin Liu wrote:
> From: Baolin Liu <liubaolin@kylinos.cn>
> 
> In barn_shrink(),use LIST_HEAD() to declare and initialize
                  ^ nit: need space after comma

> the list_head in one step instead of using INIT_LIST_HEAD() separately.
> 
> No functional change.
> 
> Signed-off-by: Baolin Liu <liubaolin@kylinos.cn>
> ---

Looks good to me,
Reviewed-by: Harry Yoo <harry.yoo@oracle.com>

-- 
Cheers,
Harry / Hyeonggon


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] mm: simplify list initialization in barn_shrink()
  2025-11-13  8:37 ` Harry Yoo
@ 2025-11-13  9:33   ` Vlastimil Babka
  0 siblings, 0 replies; 3+ messages in thread
From: Vlastimil Babka @ 2025-11-13  9:33 UTC (permalink / raw)
  To: Harry Yoo, Baolin Liu
  Cc: akpm, cl, rientjes, roman.gushchin, linux-mm, linux-kernel, Baolin Liu

On 11/13/25 09:37, Harry Yoo wrote:
> On Tue, Nov 11, 2025 at 08:22:05PM +0800, Baolin Liu wrote:
>> From: Baolin Liu <liubaolin@kylinos.cn>
>> 
>> In barn_shrink(),use LIST_HEAD() to declare and initialize
>                   ^ nit: need space after comma

Fixed up locally.

> 
>> the list_head in one step instead of using INIT_LIST_HEAD() separately.
>> 
>> No functional change.
>> 
>> Signed-off-by: Baolin Liu <liubaolin@kylinos.cn>
>> ---
> 
> Looks good to me,
> Reviewed-by: Harry Yoo <harry.yoo@oracle.com>

Thanks, applied to slab/for-next


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-13  9:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-11 12:22 [PATCH v1] mm: simplify list initialization in barn_shrink() Baolin Liu
2025-11-13  8:37 ` Harry Yoo
2025-11-13  9:33   ` Vlastimil Babka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox