folio_zero_tail(9)
β¨ NAME β¨
okay so this is the folio_zero_tail(9) page from the Kernel API Manual, and it is literally about one thing: zeroing the tail of a folio. π¦
folio_zero_tailβ zero the tail of a folio. periodt. π
πΈ SYNOPSIS πΈ
void * folio_zero_tail (struct folio *folio , size_t offset , void
*kaddr );
π ARGUMENTS π
folioβ the folio you're zeroing, bestie. πoffsetβ the byte offset in the folio where the zeroing starts. Like, the exact spot where the tail begins. β¨kaddrβ the address the folio is currently mapped to. π«Ά
π¦ DESCRIPTION π¦
So here's the vibe: if you have already used kmap_local_folio to map a folio, written some data to it, and now need to zero the end of the folio (and flush the dcache), you can use this function. No cap. π₯
π but listen β if you do not have the folio kmapped (eg the folio has been partially populated by DMA), usefolio_zero_rangeorfolio_zero_segmentinstead. do not come forfolio_zero_tailin that situation, okay? π
β RETURN β
It returns an address which can be passed to kunmap_local. that's the whole return vibe. π
π SEE ALSO π
Kernel file: ./include/linux/highmem.h β yes, that exact file, bestie. and the whole squad is: kmap(9), kunmap(9), kmap_to_page(9), kmap_flush_unused(9), kmap_local_page(9), kmap_local_folio(9), kmap_atomic(9), clear_user_page(9), clear_user_pages(9), clear_user_highpage(9), clear_user_highpages(9), vma_alloc_zeroed_movable_folio(9), memcpy_from_folio(9), memcpy_to_folio(9), folio_fill_tail(9), memcpy_from_file_folio(9), folio_zero_segments(9), folio_zero_segment(9), folio_zero_range(9), folio_release_kmap(9). π
and that's the page! signed off by the footer: source/version ./include/linux, date October 2026, title folio_zero_tail(9) β mwah ππβ¨
π¦ 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