linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Accounting for vmap_area object growth when kmemleak doesn't notice any leaks
@ 2025-10-31  2:36 Preble, Adam C
  2025-10-31  8:46 ` Lance Yang
  0 siblings, 1 reply; 3+ messages in thread
From: Preble, Adam C @ 2025-10-31  2:36 UTC (permalink / raw)
  To: linux-mm@kvack.org

Assuming I don't see any leaks from kmemleak, but I see objects growing from the vmap_area slab allocator, how could I account for the growth? Is it a leak? If so, how could I isolate them when kmemleak doesn't notice anything?

I have a workload involving an external kernel module providing a filesystem (no actual physical device) that had some leaks that kmemleak spotted and I fixed. I still eventually (very slowly now) crash the kernel by running out of memory. The only real peculiar thing I noticed is that the vmap_area slab allocator in /proc/slabinfo continues to show growth into the hundreds of thousands of objects. The workload involves loading the module, mounting the file system, running some tests, unmounting the filesystem, and ultimately unloading the module. That should reclaim everything it was doing, and I don't think I'm seeing virtual memory fragmentation since the buddy allocator seems to stabilize on a proportion of sizes (disregarding it slowly trending to the smallest size due to simply running out of total memory).

I guess I should add that /proc/meminfo shows the used vmalloc'd memory as stable this whole time. It doesn't increase. Total slab memory used does slowly rise.

I have tried to track allocations and frees to vmap area with bpftrace. I have a kretprobe on __vmalloc_node_range_noprof to hash the allocated pointer to the kernel stack, and I remove the entry when the address comes up on kprobes on kvfree and vfree. I get a few entries this way to kernel_clone()->copy_process() that I have to sort out, but I need to emphasize kmemleak doesn't point out a problem there. So I don't know if I'm just picking up some end-of-run chatter or something.



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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-31  2:36 Accounting for vmap_area object growth when kmemleak doesn't notice any leaks Preble, Adam C
2025-10-31  8:46 ` Lance Yang
2025-11-13  1:37   ` Preble, Adam C

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).