isolate_single_pageblock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME

isolate_single_pageblock β€” bestie, this one genuinely tries to isolate a pageblock that might be sitting inside a free page or an in-use page. Like, it's out here doing the work πŸ’–


✨ SYNOPSIS

int isolate_single_pageblock (unsigned long boundary_pfn , enum
pb_isolate_mode mode , bool isolate_before , bool skip_isolation );

πŸŽ€ ARGUMENTS

  • boundary_pfn β€” a pageblock-aligned pfn that a page might cross. Like the line in the sand, okurrr 🌸
  • mode β€” the isolation mode. That's it, that's the whole vibe πŸ¦‹
  • isolate_before β€” isolate the pageblock before the boundary_pfn. Yes, the one that comes first πŸ’…
  • skip_isolation β€” the flag to skip the pageblock isolation in second isolate_single_pageblock. It's giving "second time around, we're not doing that again" πŸ™ˆ

🌈 DESCRIPTION

So here's the tea, bestie: free and in-use pages can be as big as MAX_PAGE_ORDER, and they can contain more than one pageblock. Not a big deal, right? Wrong. 😭 When not all pageblocks within a page are isolated at the same time, free page accounting can go wrong. Like, actually wrong. The math stops mathing.

For example β€” and stay with me here β€” in the case of MAX_PAGE_ORDER = pageblock_order + 1, a MAX_PAGE_ORDER page has two pageblocks. Two. Not one. Two. πŸ’€

[      MAX_PAGE_ORDER         ] [  pageblock0  |  pageblock1  ]

When either pageblock is isolated, if it's a free page, the page is not split into separate migratetype lists, which is supposed to happen. Rude. And if it's an in-use page and gets freed later, __free_one_page does not split the free page either. Double rude. 😀

The function handles all of this by splitting the free page, or migrating the in-use page and then splitting the free page. That's the whole assignment, and it ate πŸ”₯πŸ‘‘


🧚 SEE ALSO


okay that's the whole page bestie, go forth and isolate responsibly 🫢✨

this icon of a page lives in ./mm and it's dated October 2026 β€” no cap, that's literally what the footer said, mwah πŸ’œ

πŸ“¦ where this page comes from