offline_and_...emory_ranges(9)
π NAME π
okay so bestie, this is the Kernel API Manual page for offline_and_...emory_ranges(9) β and the function is literally offline_and_remove_memory_ranges β offline and remove multiple memory ranges β¨.
β¨ SYNOPSIS β¨
int offline_and_remove_memory_ranges (const struct range *ranges , unsigned int nr_ranges );
π ARGUMENTS π
rangesβ array of physical address ranges to offline and remove π«Άnr_rangesβ number of entries inrangesπ
π¦ DESCRIPTION π¦
okay so this is the group project that actually works: she offlines and removes several memory ranges as one operation, serialized against other hotplug operations by a single lock_device_hotplug π₯.
The order is the whole vibe: this offlines all ranges before removing any of them. If offlining any range fails, the entire process is reverted and nothing is removed π. That gives you a fully atomic semantic for unplugging an entire device β no half-unplugged chaos, periodt.
Each range must be memory-block aligned in start and size β that is not optional, bestie π.
πΈ RETURN πΈ
0on success π- negative
errnoon failure (never positive) π
On failure, no range has been removed. Highkey iconic safety behavior, honestly.
π₯ SEE ALSO π₯
- Kernel file
./mm/memory_hotplug.c:__remove_pages(9),__add_memory_driver_managed(9),add_memory_driver_managed(9),try_offline_node(9),__remove_memory(9)π
kisses bestie, thatβs the whole page π β source/version ./mm, date October 2026, and the manual page is offline_and_...emory_ranges(9) π«Άβ¨
π¦ 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