dax_layout_busy_page_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dax_layout_busy_page_range(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual β€” yes we're reading kernel docs together, this is our bonding time 🫢. today's main character is dax_layout_busy_page_range, and honestly? she's doing a lot of quiet heavy lifting. let's get into it ✨


🌸 NAME 🌸

dax_layout_busy_page_range β€” find first pinned page in @mapping πŸ‘‘

like, literally the whole job. go find the first page that someone's got their claws in. πŸ”₯


✨ SYNOPSIS ✨

struct page * dax_layout_busy_page_range (struct address_space *mapping
, loff_t start , loff_t end );

she returns a struct page *, periodt. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • mapping β€” the address space we're scanning for a page whose ref count is > 1. basically the neighborhood we're snooping through πŸ‘€
  • start β€” Starting offset. the page containing 'start' is included, no cap. 🌈
  • end β€” End offset. the page containing 'end' is included too (inclusive girlies rise πŸ™Œ). but here's the cute part: if 'end' is LLONG_MAX, then pages from 'start' all the way till the end of file are included. the whole buffet. πŸ“

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so real talk β€” DAX requires ZONE_DEVICE mapped pages, and those pages are never page->count == 1. like, never ever. not a vibe they do. 😭

a filesystem uses this interface to determine if any page in the mapping is busy β€” i.e. busy for DMA, or other get_user_pages usages. so if a page is out here living its best life being used by someone else, this function will find it. πŸ”

it is expected that the filesystem is holding locks to block the establishment of new mappings in this address_space. i.e. it expects to be able to run unmap_mapping_range and subsequently not race mapping_mapped becoming true.

⚠️ key word: expected. this isn't the function doing the locking for you, bestie β€” you gotta hold those locks. otherwise you're racing and racing is not the move. πŸ’€

🧚 SEE ALSO 🧚

Kernel file ./fs/dax.c:

the whole dax friend group, iykyk πŸ‘‘πŸ’œ


and that's the page, bestie!! brought to you by the fine folks at ./fs, dated October 2026, and yes this icon is still called dax_layout_busy_page_range(9) β€” slay, she kept her name πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from