swiotlb_search_area(9)
π« swiotlb_search_area(9) π«
okay so this is a page from the Kernel API Manual and honestly? it's a little baddie. it's called swiotlb_search_area and its whole personality is searching one memory area in all pools. one area. all pools. she's thorough. π
β¨ SYNOPSIS β¨
int swiotlb_search_area (struct device *dev , int start_cpu , int
cpu_offset , phys_addr_t orig_addr , size_t alloc_size , unsigned int
alloc_align_mask , struct io_tlb_pool **retpool );
seven arguments bestie. seven. she's high-maintenance but she's worth it π
πΈ ARGUMENTS πΈ
devβ the device that's mapping the buffer. it's giving "who do you belong to" energy.start_cpuβ the CPU number you're starting from. your little launchpad πcpu_offsetβ how far you're offset fromstart_cpu. yes it's relative, yes it matters.orig_addrβ the original (non-bounced) IO buffer address. the real one, before the bounce glow-up β¨alloc_sizeβ total requested size of the bounce buffer, including the initial alignment padding. don't forget the padding, she counts it, fr fr.alloc_align_maskβ the required alignment of the allocated buffer. the vibe check for where things can sit π¦retpoolβ the used memory pool, updated on return. she writes back to you, that's the whole point π
π₯ DESCRIPTION π₯
so what does she actually do? she searches one memory area across all pools, hunting for a sequence of slots that match the allocation constraints. that's it. that's the whole job. no cap. π
like, imagine you need a run of slots that fit certain rules, and you're checking one specific area in every pool until something matches. iconic behavior honestly. π
π RETURN π
- the index of the first allocated slot β slay, you found one π«Ά
- or
-1on error β not slay, something went wrong π
heads up bestie: -1 is the failure signal here, so don't go treating it like a valid index. that would be a bad time. π
π¦ SEE ALSO π¦
Kernel file ./kernel/dma/swiotlb.c, plus the whole friend group: struct io_tlb_slot(9), struct io_tlb_area(9), swiotlb_adjust_nareas(9), limit_nareas(9), add_mem_pool(9), alloc_dma_pages(9), swiotlb_alloc_tlb(9), swiotlb_free_tlb(9), swiotlb_alloc_pool(9), swiotlb_dyn_alloc(9), __swiotlb_find_pool(9), swiotlb_del_pool(9), swiotlb_dev_init(9), swiotlb_align_offset(9), swiotlb_search_pool_area(9), swiotlb_find_slots(9), mem_pool_used(9), mem_used(9), swiotlb_tbl_map_single(9), swiotlb_del_transient(9), is_swiotlb_allocated(9), default_swiotlb_base(9), default_swiotlb_limit(9). go read them, they're literally all right there π
okay and for the cute sign-off: this little masterpiece lives in ./kernel/dma and it's stamped October 2026. future-coded of her. see you in the pools 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