linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ke Sun <sunke@kylinos.cn>
To: Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>
Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org,
	Ke Sun <sunke@kylinos.cn>
Subject: [PATCH] maple_tree: use KMEM_CACHE to create maple_node caches
Date: Mon,  4 Nov 2024 14:16:17 +0800	[thread overview]
Message-ID: <20241104061617.450907-1-sunke@kylinos.cn> (raw)

Use the KMEM_CACHE() macro instead of kmem_cache_create() to simplify
the creation of SLAB caches.

Signed-off-by: Ke Sun <sunke@kylinos.cn>
---
 lib/maple_tree.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 3619301dda2e..60be142e35c6 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -6299,9 +6299,7 @@ bool mas_nomem(struct ma_state *mas, gfp_t gfp)
 
 void __init maple_tree_init(void)
 {
-	maple_node_cache = kmem_cache_create("maple_node",
-			sizeof(struct maple_node), sizeof(struct maple_node),
-			SLAB_PANIC, NULL);
+	maple_node_cache = KMEM_CACHE(maple_node, SLAB_PANIC);
 }
 
 /**
-- 
2.34.1



             reply	other threads:[~2024-11-04  6:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-04  6:16 Ke Sun [this message]
2024-11-04 13:27 ` Matthew Wilcox
2024-11-05  2:21   ` Ke Sun
2024-11-05  4:17     ` Matthew Wilcox
2024-11-05  2:34 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241104061617.450907-1-sunke@kylinos.cn \
    --to=sunke@kylinos.cn \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=maple-tree@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox