create_basic_memory_bitmaps(9)
π create_basic_memory_bitmaps(9) β the kernel API manual, but make it make sense π
okay so bestie, welcome to the <bold>kernel API manual</bold> β¨ β this one's a create_basic_memory_bitmaps(9) situation and honestly? it's a little guy with one job and it does it well. let's get into it π«Ά
β¨ NAME β¨
create_basic_memory_bitmaps β literally just: create bitmaps to hold basic page information. that's the whole vibe π
πΈ SYNOPSIS πΈ
int create_basic_memory_bitmaps (void );
π¦ ARGUMENTS π¦
voidβ no arguments. nothing. zero. the void is voiding π
π₯ DESCRIPTION π₯
so here's the tea β β this function creates the bitmaps you need for two things:
- marking page frames that
should not be saved - marking free page frames
and the <hotpink>forbidden_pages_map</hotpink> and <hotpink>free_pages_map</hotpink> pointers? they only get modified <bold>if everything goes well</bold> β that's not a flex, that's a whole design decision. the reasoning is that we don't` want the bits touched before both bitmaps are set up. like, no cap, both or nothing. all-or-nothing energy. iconic β¨
fr fr β the "only if everything goes well" part is the whole point. don't be out here expecting those pointers to move on a failure, because they won't. π
π SEE ALSO π
here's the whole friend group π«Ά β and btw this all lives in the kernel file <purple>./kernel/power/snapshot.c</purple>:
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)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)
go read them all, i'll wait π
and that's the page babes π β brought to you by the <mint>./kernel/power</mint> directory, <yellow>October 2026</yellow> edition, still out here explaining create_basic_memory_bitmaps(9) to the masses. slay, stay hydrated, and remember: both bitmaps or nothing π
ππ
π¦ 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