Linux-Block Archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: Simplify the allocation of slab caches
@ 2024-01-31  9:43 Kunwu Chan
  2024-01-31 10:08 ` Johannes Thumshirn
  2024-02-08 18:32 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Kunwu Chan @ 2024-01-31  9:43 UTC (permalink / raw
  To: axboe; +Cc: linux-block, linux-kernel, Kunwu Chan

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

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
---
 block/blk-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index f28859b4a3ef..6898d2e6e3c4 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1224,8 +1224,7 @@ int __init blk_dev_init(void)
 	if (!kblockd_workqueue)
 		panic("Failed to create kblockd\n");
 
-	blk_requestq_cachep = kmem_cache_create("request_queue",
-			sizeof(struct request_queue), 0, SLAB_PANIC, NULL);
+	blk_requestq_cachep = KMEM_CACHE(request_queue, SLAB_PANIC);
 
 	blk_debugfs_root = debugfs_create_dir("block", NULL);
 
-- 
2.39.2


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

* Re: [PATCH] block: Simplify the allocation of slab caches
  2024-01-31  9:43 [PATCH] block: Simplify the allocation of slab caches Kunwu Chan
@ 2024-01-31 10:08 ` Johannes Thumshirn
  2024-02-08 18:32 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2024-01-31 10:08 UTC (permalink / raw
  To: Kunwu Chan, axboe@kernel.dk
  Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH] block: Simplify the allocation of slab caches
  2024-01-31  9:43 [PATCH] block: Simplify the allocation of slab caches Kunwu Chan
  2024-01-31 10:08 ` Johannes Thumshirn
@ 2024-02-08 18:32 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2024-02-08 18:32 UTC (permalink / raw
  To: Kunwu Chan; +Cc: linux-block, linux-kernel


On Wed, 31 Jan 2024 17:43:23 +0800, Kunwu Chan wrote:
> Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
> to simplify the creation of SLAB caches.
> 
> 

Applied, thanks!

[1/1] block: Simplify the allocation of slab caches
      commit: 48ff13a618b54aabc447659a9016068cf0cae322

Best regards,
-- 
Jens Axboe




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

end of thread, other threads:[~2024-02-08 18:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-31  9:43 [PATCH] block: Simplify the allocation of slab caches Kunwu Chan
2024-01-31 10:08 ` Johannes Thumshirn
2024-02-08 18:32 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).