VM_MAP_SYNC(9)
π VM_MAP_SYNC(9) π
okay bestie, this is a page from the Kernel Developer's Manual β section 9, kernel nerd territory β and it's all about vm_map_sync, the little function that makes sure your dirty pages go home to their pager. π β¨
πΈ NAME πΈ
vm_map_sync β push dirty pages to their pager π
β¨ SYNOPSIS β¨
#include <sys/param.h>
#include <vm/vm.h>
#include <vm/vm_map.h>
int
vm_map_sync(vm_map_t map, vm_offset_t start, vm_offset_t end,
boolean_t syncio, boolean_t invalidate);
like. look at those args. four whole parameters. she's serving function signature. π
π¦ DESCRIPTION π¦
So here's the tea: vm_map_sync() grabs every dirty cached page hanging out in the range from start to end inside map, and forces them all to be pushed to their underlying pager. no page left behind, fr fr. π
If syncio is TRUE, those dirty pages get written synchronously. like, right now. no waiting around, no vibes-based timing, just write. β‘
If invalidate is TRUE, any cached pages also get freed. bye bye, you will not be missed. π«Ά
β οΈ bestie listen up, this is the important part: the range you provide must be contiguous. It MUST NOT contain holes. And it MUST NOT contain any sub-map entries. not even one. the function will simply not be having it. π
π RETURN VALUES π
vm_map_sync() returns KERN_SUCCESS when everything went great. slay. β¨
Otherwise? yeah, it's giving errors:
KERN_INVALID_ADDRESSgets returned if the function ran into a sub-map entry. πKERN_INVALID_ARGUMENTgets returned if the function found a hole in the region you provided, or if an entry could not be found for the givenstartaddress. π
π SEE ALSO π
go read that one too, iykyk. π§
π AUTHORS π
This manual page was written by Bruce M Simpson <bms@spc.org>. king behavior honestly. π
and that's the whole page, bestie!! this one's from Debian, dated July 9, 2011, and it's page VM_MAP_SYNC(9) of the Kernel Developer's Manual. mwah. ππβ
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms