ksm_disable_merge_any(9)
π ksm_disable_merge_any(9) β the Kernel API Manual moment
okay so bestie, welcome to the ksm_disable_merge_any page from the Kernel API Manual β¨ this one's short and sweet and it's literally the "undo" button for merge mode, so let's get into it π«Ά
πΈ NAME πΈ
ksm_disable_merge_any β turns merging off for all the compatible VMA's of the mm, the ones you previously switched on with ksm_enable_merge_any(). no cap, it's the reverse of that whole situation π«
β¨ SYNOPSIS β¨
int ksm_disable_merge_any (struct mm_struct *mm );
π ARGUMENTS π
mmβ pointer tomm. that's it. that's the whole argument. she's lowkey simple π
π¦ DESCRIPTION π¦
so like, disabling merging implies unmerging any pages that are currently merged β think of it as the same energy as setting MADV_UNMERGEABLE would have π it's not just flipping a flag, she actually goes in and undoes the merges.
β οΈ and here's the part you can't skip: if the unmerging fails, the whole operation fails, and merging on all compatible VMA's remains enabled. so no half-and-half situation, it's all or nothing bestie π
Returns 0 on success, otherwise an error code. periodt π
π§ SEE ALSO π§
- Kernel file
./mm/ksm.c Overview(9)struct ksm_mm_slot(9)struct ksm_scan(9)struct ksm_stable_node(9)struct ksm_rmap_item(9)struct advisor_ctx(9)replace_page(9)ksm_do_scan(9)ksm_vma_flags(9)ksm_enable_merge_any(9)
go read all of those too, iykyk ππ
and that's the page!! this iconic little number lives in ./mm, dated October 2026 β mwah, stan a kernel doc that keeps it short ππ
slay, you're now a ksm_disable_merge_any expert π
π¦ 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