swiotlb_alloc_tlb(9)
π swiotlb_alloc_tlb(9) β like, the Kernel API Manual, bestie β¨
okay so this is a page from the Kernel API Manual, and it's about swiotlb_alloc_tlb β yes that's the name, yes I said it out loud, no I will not say it again π«Ά
β¨ NAME β¨
swiotlb_alloc_tlb β allocate a dynamic IO TLB buffer π
π¦ SYNOPSIS π¦
struct page * swiotlb_alloc_tlb (struct device *dev , struct io_tlb_mem
*mem , size_t bytes , u64 phys_limit , gfp_t gfp , void **vaddr );
literally the whole signature, copied exact, no cap π
πΈ ARGUMENTS πΈ
devβ the Device that we're allocating a memory pool for. it's giving "who is this for" energy πmemβ the SWIOTLB allocator for the pool. the main character of the allocator world fr β¨bytesβ size of the buffer. how big, bestie πphys_limitβ maximum allowed physical address of the buffer. a hard ceiling, no vibes above this line π«gfpβ the GFP flags for the allocation. it's giving "how should we do this" πvaddrβ receives the virtual address for the allocated buffer. it's an out-param, so it gets filled in, she doesn't give, she receives π
β RETURN β
Allocated pages, or NULL on allocation failure. so likeβ¦ either you get pages or you get nothing and you have to deal with it π check for NULL, please, I'm begging π
π SEE ALSO π
Kernel file ./kernel/dma/swiotlb.c, plus the whole friend group β every single one of them, and yes I'm listing all of them because they all matter, periodt:
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_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_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)
like, that's the whole group chat right there π«Άπ
kay bye, this page lives in ./kernel/dma and it's dated October 2026 β so yeah, future girl summer, slay π§ββοΈπ
π¦ 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