kmemleak_not_leak(9)
π kmemleak_not_leak β the kernel API manual, bestie edition
okay so this is kmemleak_not_leak(9), straight out of the kernel API manual, and it's lowkey one of the most useful little guys in the whole leak-detector friend group π«Ά
β¨ NAME β¨
kmemleak_not_leak β mark an allocated object as a false positive π
like, the leak detector was being a little dramatic and this is how you tell it "no babe, that one's fine" π
πΈ SYNOPSIS πΈ
void __ref kmemleak_not_leak (const void *ptr );
that's it. that's the whole vibe. no cap β¨
π¦ ARGUMENTS π¦
ptrβ pointer to beginning of the object π (yes, the beginning, bestie, don't be out here handing it a random offset π)
π DESCRIPTION π
so the way this works: when you call this function on an object, the memory block will no longer be reported as leak and will always be scanned. periodt. π
it's giving "i've reviewed this one personally and she's innocent" energy β you're clearing the block's name and telling the scanner to keep an eye on it anyway. iconic behavior, honestly π
ngl, this is your go-to when a block looks lost but it's actually referenced somewhere kmemleak just can't see (iykyk π). you're vouching for it, so vouch responsibly π
β SEE ALSO β
kernel file ./mm/kmemleak.c β the source of truth, go read her π
and the whole extended fam, fr fr:
kmemleak_alloc(9)kmemleak_alloc_percpu(9)kmemleak_vmalloc(9)kmemleak_free(9)kmemleak_free_part(9)kmemleak_free_percpu(9)kmemleak_update_trace(9)kmemleak_transient_leak(9)kmemleak_ignore_percpu(9)kmemleak_ignore(9)kmemleak_scan_area(9)kmemleak_no_scan(9)kmemleak_alloc_phys(9)kmemleak_free_part_phys(9)kmemleak_ignore_phys(9)
π§ sign-off π§
this page lives in ./mm, dated October 2026, and its whole title-slash-name is kmemleak_not_leak(9) β so go forth, mark your false positives, and slay πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms