pack_pfns(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– pack_pfns(9) β€” like, the PFN packing girlie πŸ’–

okay so real talk, we're in the <pink>pack_pfns</pink> page of the Kernel API Manual today and honestly? it's a little baddie. she's short, she's specific, she gets the job done. let's go 🫢


✨ NAME ✨

pack_pfns β€” Prepare PFNs for saving.

that's it. that's the whole vibe. she preps the PFNs so they can be saved, no cap πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

void pack_pfns (unsigned long *buf , struct memory_bitmap *bm , struct
memory_bitmap *zero_bm );

copy it exactly bestie, spacing and all, this is not a drill 😭


🌸 ARGUMENTS 🌸

  • buf β€” the memory buffer where the PFNs get stashed. it's the lil home for your packed lil guys 🏠
  • bm β€” a memory bitmap. yes queen, the bitmap.
  • zero_bm β€” another memory bitmap, but this one's holding the PFNs of the zero pages. special girl energy ⭐

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea πŸ”₯ β€” the PFNs that correspond to the set bits in bm get stored into the area of memory that buf points at. and it happens <purple>1 page at a time</purple>, like one page per pass, very methodical, very main character πŸ’…

and then! the pages that were filled with <cyan>only zeros</cyan>? those special ones get the highest bit set in the packed format. why?? so you can tell them apart from the PFNs that will be contained in the image file. iykyk 🧚 nobody wants zero pages and image-file PFNs getting confused, that would be chaos πŸ’€


🌈 SEE ALSO 🌈

this list is LONG and it's giving "everyone showed up to the party" πŸŽ‰ also we're shouting out the Kernel file ./kernel/power/snapshot.c:

like, the whole friend group fr fr πŸ‘‘ go read them too, they're all iconic.


ok that's the page!! mwah πŸ’‹ this one lives under ./kernel/power and it's dated <peach>October 2026</peach> β€” yeah, from the future, she's ahead of her time ⭐✨ bye bestie, love u πŸ«ΆπŸ’œ
πŸ“¦ where this page comes from