region_intersects(9)
π region_intersects β¨
okay so this is the Kernel API Manual page for region_intersects and honestly it's a whole vibe β it's the little function that asks "hey, does this chunk of memory overlap something important?" and it does it FAST. let's get into it π«Ά
πΈ NAME πΈ
region_intersects β bestie, it literally figures out the intersection of a region with the known resources. that's the whole job. no cap π
β¨ SYNOPSIS β¨
int region_intersects (resource_size_t start , size_t size , unsigned
long flags , unsigned long desc );
like, it takes four things and gives you back an int. periodt.
π ARGUMENTS π
startβ the region start address π where the whole thing begins, fr frsizeβ size of region. yes bestie, how big it is πΈflagsβ flags of resource (iniomem_resource) β these are the vibes you're matching againstdescβ descriptor of resource (iniomem_resource) orIORES_DESC_NONE. theIORES_DESC_NONEoption is the "I don't care, match anything" energy π
π₯ DESCRIPTION π₯
okay so here's the tea β β it checks whether the specified region partially overlaps or fully eclipses a resource identified by flags and desc (and desc is optional, with IORES_DESC_NONE).
and then it returns one of these three icons:
- returns
REGION_DISJOINTif the region does not overlapflags/descπ like, nothing in common, they don't know each other - returns
REGION_MIXEDif the region overlapsflags/descand another resource π it's complicated, it's seeing other resources - returns
REGION_INTERSECTSif the region overlapsflags/descand no other defined resource π
β οΈ lowkey important caveat: REGION_INTERSECTS is also returned in the case when the specified region overlaps RAM and undefined memory holes. so don't come for this function when it says INTERSECTS about your RAM + holes situation β that's by design bestie π«Ά
aaaand the main character detail: region_intersect is used by memory remapping functions to make sure the user is not remapping RAM, and it's a vast speed up over walking through the resource table page by page. like, it ATE and left no crumbs π₯ no more page-by-page suffering, we love efficiency π
π¦ SEE ALSO π¦
so many siblings, it's giving huge family group chat π all these icons live in the kernel file ./kernel/resource.c:
request_resource_conflict(9)request_resource(9)release_resource(9)find_next_res(9)walk_iomem_res_desc(9)find_resource_space(9)reallocate_resource(9)allocate_resource(9)lookup_resource(9)insert_resource_conflict(9)insert_resource(9)insert_resource_expand_to_fit(9)remove_resource(9)adjust_resource(9)resource_alignment(9)__request_region(9)__release_region(9)release_mem_region_adjustable(9)merge_system_ram_resource(9)devm_request_resource(9)devm_release_resource(9)devm_request_free_mem_region(9)alloc_free_mem_region(9)
go read those too, iykyk π
mwah π this page lives in ./kernel, dated October 2026 β stay hydrated, don't remap RAM, and slay your resource checks bestie π§β¨
π¦ 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