mshv_region_process_chunk(9)
β¨ mshv_region_process_chunk(9) β¨
okay so bestie, welcome to the Kernel API Manual β this one's from mshv_region_process_chunk(9) and it's literally about wrangling chunks of memory pages π
π NAME π
mshv_region_process_chunk β processes a contiguous chunk of memory pages in a region. no cap, that's the whole vibe β¨
π¦ SYNOPSIS π¦
long mshv_region_process_chunk (struct mshv_mem_region *region , u32
flags , u64 page_offset , u64 page_count , int (*handler)(struct
mshv_mem_region *region, u32 flags, u64 page_offset, u64 page_count,
bool huge_page) );
like look at that signature. it's giving long, it's giving callback, it's giving everything π
πΈ ARGUMENTS πΈ
regionβ pointer to the memory region structure. the main character, honestly πflagsβ flags to pass to the handler. just hand 'em over, don't overthink it π«Άpage_offsetβ offset into the region's pages array where you wanna start processing. your starting line, bestie βpage_countβ the number of pages to process. how many we're doing today, periodt πhandlerβ the callback function that handles the chunk. the one who actually does the work while you sit there looking pretty π
π DESCRIPTION π
so basically this function scans the region's pages, starting from page_offset, and checks for contiguous present pages of the same size β could be normal pages, could be huge pages, either way it's valid β¨
then it invokes handler on the chunk of contiguous pages it found. the way that it just... finds your people and introduces you ππ
it returns the number of pages handled, or a negative error code if the first page isn't present or if the handler fails. like if the very first page ghosted you, that's a wrap π
β NOTE β
important bestie!! the handler callback must be able to handle both normal and huge pages. no picking favourites, no exceptions. it's gotta be versatile or it's not invited to the function π
π₯ RETURN π₯
number of pages handled, or a negative error code. simple as that, iykyk π
π§ SEE ALSO π§
kernel file ./drivers/hv/mshv_regions.c plus the whole friend group:
mshv_chunk_stride(9)mshv_region_process_range(9)mshv_region_range_fault(9)mshv_region_interval_invalidate(9)
and that's the page!! brought to you by ./drivers/hv, dated October 2026 β mwah, go read the kernel source, ily π«Άπ
π¦ 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