memory_bm_next_pfn(9)
π memory_bm_next_pfn(9) β the Kernel API Manual, bestie β¨
okay so welcome to the Kernel API Manual entry for memory_bm_next_pfn(9) β she's a little function with main character energy and she's literally about to walk you through a memory bitmap π¦
πΈ NAME πΈ
memory_bm_next_pfn β find the next set bit in a memory bitmap. that's it, that's the whole vibe π
β¨ SYNOPSIS β¨
unsigned long memory_bm_next_pfn (struct memory_bitmap *bm );
like, she takes one pointer and gives you back an unsigned long. no cap π«Ά
π ARGUMENTS π
bmβ the memory bitmap. your girl. the one you're scanning π
π¦ DESCRIPTION π¦
so here's the tea π β starting from the last returned position, this function searches for the next set bit in bm and returns the PFN that bit represents. it's giving "keep going where we left off" energy, and honestly? obsessed.
and if there are no more bits set? she doesn't ghost you, she just returns BM_END_OF_MAP. iconic behavior, very demure π
β οΈ real talk though: it is required to run memory_bm_position_reset before the first call to this function for the given memory bitmap. like, do not skip this step bestie, it's not optional, the vibes will be ruined π
π₯ SEE ALSO π₯
the whole friend group lives in the kernel file ./kernel/power/snapshot.c β say hi to all of them for me π
get_image_page(9)free_image_page(9)alloc_rtree_node(9)free_mem_extents(9)create_mem_extents(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)pack_pfns(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)
and that's the whole page, bestie π« this lil icon came from ./kernel/power, dated October 2026, and it's filed under memory_bm_next_pfn(9) β go forth and scan those bitmaps, iykyk ππ
π¦ 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