kmsan_free_page(9)
π kmsan_free_page β like, the KMSAN heads-up for a free_pages() call
okay so this is kmsan_free_page, straight out of the Kernel API Manual (section 9, kernel-flavored, iykyk) β and bestie, it's a tiny little function with one very specific job and I'm obsessed with how unbothered it is π
β¨ SYNOPSIS β¨
void kmsan_free_page (struct page *page , unsigned int order );
that's it. that's the whole signature. she's short, she's sweet, she returns void because she has nothing to say back to you π
πΈ ARGUMENTS πΈ
pageβ astruct pagepointer, and it's literally the exact same one that got passed tofree_pages. no sneaky substitution, just hand her the same pointer, bestie π«Άorderβ the order of the deallocatedstruct page. yes, theorder. give her the number, she needs the number π₯
π¦ DESCRIPTION π¦
so here's the vibe: KMSAN marks freed memory as uninitialized. that's it. that's the whole personality π
like, not me explaining it in one sentence π β she's a notifier, she tells KMSAN "hey girl, this page just got freed," and KMSAN goes "say less" and marks that memory as uninitialized. main character energy, no cap β¨
π SEE ALSO π
the whole KMSAN friend group, fr fr β they all live in the kernel file ./include/linux/kmsan.h:
kmsan_task_create(9)kmsan_task_exit(9)kmsan_init_shadow(9)kmsan_init_runtime(9)kmsan_memblock_free_pages(9)kmsan_alloc_page(9)kmsan_copy_page_meta(9)kmsan_slab_alloc(9)kmsan_slab_free(9)kmsan_kmalloc_large(9)kmsan_kfree_large(9)kmsan_ioremap_page_range(9)kmsan_iounmap_page_range(9)kmsan_handle_dma(9)kmsan_handle_dma_sg(9)kmsan_handle_urb(9)kmsan_unpoison_entry_regs(9)kmsan_get_metadata(9)kmsan_enable_current(9)kmsan_disable_current(9)memset_no_sanitize_memory(9)
like, the entire group chat π go read them, they ate π
ngl the whole ./include/linux directory is where the lore lives β that's the source location, and this page is dated October 2026 β
and that's the page, bestie β slay, periodt, go free some pages responsibly π§π
π¦ 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