All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libxfs: remove the duplicate allocation of xfs_extfree_item_cache
@ 2025-11-13  6:48 Wu Guanghao
  2025-11-13  8:07 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Wu Guanghao @ 2025-11-13  6:48 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, yangyun50

In init_caches(),the xfs_extfree_item_cache is being repeatedly initialized.
The code flow is as follows:

init_caches()
    ...
    xfs_defer_init_item_caches()
        xfs_extfree_intent_init_cache()
            // first alloc
            xfs_extfree_item_cache = kmem_cache_create("xfs_extfree_intent",...);
    ...
    // second alloc
    xfs_extfree_item_cache = kmem_cache_init(..., "xfs_extfree_item");

So, remove the duplicate allocation code.

Signed-off-by: Wu Guanghao <wuguanghao3@huawei.com>
---
 libxfs/init.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/libxfs/init.c b/libxfs/init.c
index 393a9467..a5e89853 100644
--- a/libxfs/init.c
+++ b/libxfs/init.c
@@ -214,9 +214,6 @@ init_caches(void)
 		fprintf(stderr, "Could not allocate btree cursor caches.\n");
 		abort();
 	}
-	xfs_extfree_item_cache = kmem_cache_init(
-			sizeof(struct xfs_extent_free_item),
-			"xfs_extfree_item");
 	xfs_trans_cache = kmem_cache_init(
 			sizeof(struct xfs_trans), "xfs_trans");
 	xfs_parent_args_cache = kmem_cache_init(
@@ -236,7 +233,6 @@ destroy_caches(void)
 	leaked += kmem_cache_destroy(xfs_da_state_cache);
 	xfs_defer_destroy_item_caches();
 	xfs_btree_destroy_cur_caches();
-	leaked += kmem_cache_destroy(xfs_extfree_item_cache);
 	leaked += kmem_cache_destroy(xfs_trans_cache);
 	leaked += kmem_cache_destroy(xfs_parent_args_cache);

-- 
2.27.0

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

* Re: [PATCH] libxfs: remove the duplicate allocation of xfs_extfree_item_cache
  2025-11-13  6:48 [PATCH] libxfs: remove the duplicate allocation of xfs_extfree_item_cache Wu Guanghao
@ 2025-11-13  8:07 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2025-11-13  8:07 UTC (permalink / raw)
  To: Wu Guanghao; +Cc: Darrick J. Wong, linux-xfs, yangyun50

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>


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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-13  6:48 [PATCH] libxfs: remove the duplicate allocation of xfs_extfree_item_cache Wu Guanghao
2025-11-13  8:07 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.