swiotlb_search_pool_area(9)
β¨ swiotlb_search_pool_area π
okay bestie, welcome to the swiotlb_search_pool_area(9) page from the Kernel API Manual β yes that's the whole title, we're folding it in here at the top like a little name tag π
Like, the whole entire vibe of this function? Searching, like, one memory area in one pool. That's it. That's the function. And honestly? iconic.
πΈ SYNOPSIS πΈ
int swiotlb_search_pool_area (struct device *dev , struct io_tlb_pool
*pool , int area_index , phys_addr_t orig_addr , dma_addr_t tbl_dma_addr
, size_t alloc_size , unsigned int alloc_align_mask );
no cap, that's the whole signature, character for character, don't come for me π«Ά
π¦ ARGUMENTS π¦
devβ the device that's mapping the buffer. main character energy tbh.poolβ the memory pool we're gonna search through. like digging through your bag for your lip gloss πarea_indexβ the index of the IO TLB memory area we're searching. yes, an index. a number. specific.orig_addrβ the original (non-bounced) IO buffer address. the real one. the pre-bounce one. periodt.tbl_dma_addrβ the DMA address of the bounce buffer.alloc_sizeβ total requested size of the bounce buffer, including the initial alignment padding. don't forget the padding bestie, it's part of the size fr fr.alloc_align_maskβ the required alignment of the allocated buffer. the mask. the alignment. you know how it is β¨
π§ DESCRIPTION π§
So what does it do? It finds a suitable sequence of IO TLB entries for the request and allocates a buffer from the given IO TLB memory area. Literally that. Match made in heaven between your request and some entries π
And the best part? This function takes care of locking. like, it handles the locking for you. no need to stress, she's got it π
β RETURN β
- The index of the first allocated slot β slay π
- Or
-1on error β π it happens, we move on
π SEE ALSO π
okay this is the whole squad, everybody's here, no one got left out π«Ά
Kernel file ./kernel/dma/swiotlb.c β plus, in no particular order but actually yes this exact order:
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_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)
ok that's the page!! go touch some DMA buffers, stay aligned, and remember: she handles the locking for you π
mwah π β this little number lives in ./kernel/dma, dated October 2026, and it's called swiotlb_search_pool_area(9) if you forgot already (you didn't, you're doing amazing) π
π¦ 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