shmem_writeout(9)
π shmem_writeout β a kernel API manual, but make it make sense
okay so bestie, you found your way to shmem_writeout(9), the third section (kernel API) manual page. pull up a chair, grab a strawberry π, and let's get into it β this one's short but she's iconic.
β¨ NAME β¨
shmem_writeout β literally just: write the folio to swap. that's the whole vibe. π«
π¦ SYNOPSIS π¦
int shmem_writeout (struct swap_io_ctx *ctx , struct folio *folio ,
struct list_head *folio_list );
like yes, it returns an int, and yes, those are the exact parameters, don't @ me.
π ARGUMENTS π
ctxβ the swap I/O context. she's the whole situation, the group chat the operation happens in. π«Άfolioβ the folio to write. the main character, fr fr. πfolio_listβ the list to put back folios on split. yes, "on split" β that's the exact wording, i'm not making this up. π
π₯ DESCRIPTION π₯
move the folio from the page cache to the swap cache. that's it. that's the description. no cap, no extra lore, just a relocation. the way that she just moves π
π SEE ALSO π
- kernel file
./mm/shmem.c shmem_recalc_inode(9)shmem_get_folio(9)shmem_kernel_file_setup(9)shmem_file_setup(9)shmem_file_setup_with_mnt(9)shmem_zero_setup(9)shmem_zero_setup_desc(9)shmem_read_folio_gfp(9)
go read those too, iykyk πβ¨
lowkey a warning-ish thing: the manpage doesn't editorialize here, but do note the folio_list argument exists specifically for putting folios back on split β don't just pass garbage, bestie. π
and that's the page!! π§ source/version: ./mm, dated October 2026, and the whole thing is filed under shmem_writeout(9). mwah, go write some folios ππΈ
π¦ 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