linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mm: slub: allocate slab object extensions non-contiguously
@ 2025-05-20 12:25 Usama Arif
  2025-05-20 12:25 ` [PATCH 2/2] mm: slub: only warn once when allocating slab obj extensions fails Usama Arif
                   ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Usama Arif @ 2025-05-20 12:25 UTC (permalink / raw)
  To: Andrew Morton, surenb
  Cc: hannes, shakeel.butt, vlad.wing, linux-mm, kent.overstreet,
	linux-kernel, kernel-team, Usama Arif

When memory allocation profiling is running on memory bound services,
allocations greater than order 0 for slab object extensions can fail,
for e.g. zs_handle zswap slab which will be 512 objsperslab x 16 bytes
per slabobj_ext (order 1 allocation). Use kvcalloc to improve chances
of the allocation being successful.

Signed-off-by: Usama Arif <usamaarif642@gmail.com>
Reported-by: Vlad Poenaru <vlad.wing@gmail.com>
Closes: https://lore.kernel.org/all/17fab2d6-5a74-4573-bcc3-b75951508f0a@gmail.com/
---
 mm/slub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/slub.c b/mm/slub.c
index dc9e729e1d26..bf43c403ead2 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1989,7 +1989,7 @@ int alloc_slab_obj_exts(struct slab *slab, struct kmem_cache *s,
 	gfp &= ~OBJCGS_CLEAR_MASK;
 	/* Prevent recursive extension vector allocation */
 	gfp |= __GFP_NO_OBJ_EXT;
-	vec = kcalloc_node(objects, sizeof(struct slabobj_ext), gfp,
+	vec = kvcalloc_node(objects, sizeof(struct slabobj_ext), gfp,
 			   slab_nid(slab));
 	if (!vec) {
 		/* Mark vectors which failed to allocate */
-- 
2.47.1



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

end of thread, other threads:[~2025-05-22 12:42 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-20 12:25 [PATCH 1/2] mm: slub: allocate slab object extensions non-contiguously Usama Arif
2025-05-20 12:25 ` [PATCH 2/2] mm: slub: only warn once when allocating slab obj extensions fails Usama Arif
2025-05-20 13:34   ` Harry Yoo
2025-05-20 13:42     ` Usama Arif
2025-05-20 14:18       ` Shakeel Butt
2025-05-20 15:14         ` Suren Baghdasaryan
2025-05-20 15:22         ` Usama Arif
2025-05-22  0:16           ` Harry Yoo
2025-05-22 12:42             ` Usama Arif
2025-05-20 13:44 ` [PATCH 1/2] mm: slub: allocate slab object extensions non-contiguously Kent Overstreet
2025-05-20 13:46   ` Usama Arif
2025-05-20 14:01     ` Kent Overstreet
2025-05-20 14:24       ` Shakeel Butt
2025-05-20 14:28         ` Kent Overstreet
2025-05-20 17:44           ` Uladzislau Rezki
2025-05-20 17:47             ` Kent Overstreet
2025-05-20 17:57               ` Uladzislau Rezki
2025-05-20 17:58                 ` Kent Overstreet
2025-05-20 18:59                   ` Uladzislau Rezki
2025-05-20 14:13     ` Usama Arif
2025-05-20 15:20       ` Suren Baghdasaryan
2025-05-20 16:41         ` Kent Overstreet
2025-05-20 17:20           ` Suren Baghdasaryan
2025-05-20 17:25             ` Kent Overstreet
2025-05-20 17:18         ` Johannes Weiner
2025-05-20 14:01 ` Usama Arif

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 NNTP newsgroup(s).