pack_pfns(9)
π 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:
get_image_page(9)free_image_page(9)alloc_rtree_node(9)free_mem_extents(9)create_mem_extents(9)memory_bm_next_pfn(9)mark_nosave_pages(9)create_basic_memory_bitmaps(9)free_basic_memory_bitmaps(9)snapshot_additional_pages(9)count_free_highmem_pages(9)count_highmem_pages(9)count_data_pages(9)swsusp_free(9)preallocate_image_pages(9)free_unnecessary_pages(9)minimum_image_size(9)hibernate_preallocate_memory(9)snapshot_read_next(9)unpack_orig_pfns(9)count_highmem_image_pages(9)prepare_highmem_image(9)copy_last_highmem_page(9)prepare_image(9)snapshot_write_next(9)restore_highmem(9)
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/powerand 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
- 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