soft_offline_page(9)
π soft_offline_page (9) π
okay so bestie, welcome to the Kernel API Manual β yes that's the manual name, we're fancy here π
β and today's main character is soft_offline_page. she's a lil kernel function with big "i'm quietly saving your memory" energy, and honestly? iconic.
β¨ NAME β¨
soft_offline_page β the one that softly offlines a page π
(like, gently. respectfully. no violence.)
πΈ SYNOPSIS πΈ
int soft_offline_page (unsigned long pfn , int flags );
look at her go π«Ά that's the whole signature, exactly as-is, no notes.
π¦ ARGUMENTS π¦
pfnβ the pfn you wanna soft-offline. that's the one, the target, the chosen page β¨flagsβ flags. literally the same ones asmemory_failureuses. same flags, different function, iykyk π«
π DESCRIPTION π
okay so here's the tea β β soft_offline_page soft offlines a page, by migration or invalidation, without killing anything. no casualties. nobody gets killed. periodt.
this is for the specific situation where a page is not corrupted yet (so like, it's still valid to access, she's fine, she's functioning π ) but it has had a number of corrected errors and is better taken out. basically she keeps making tiny little mistakes and you're like "bestie maybe take a break" π
the actual policy on when to do that is maintained by user space. so the kernel is NOT the decision-maker here β user space is the one holding the clipboard going "okay who's next". not me doing policy, that's not my job π
this should never impact any application or cause data loss, however it might take some time. lowkey slow but she would never hurt you. no data loss. none. zero. we don't do that here π§
this is not a 100% solution for all memory, okay let's be real and honest β but tries to be "good enough" for the majority of memory. she's not perfect, she's just doing her best and honestly that's relatable as hell π
and the return values, because you KNOW you need them: -0β success! slay! π --EOPNOTSUPPβ returned whenhwpoison_filterfiltered the error event, or when it's disabled by/proc/sys/vm/enable_soft_offlineπ« -< 0β anything else, and it's the negated errno. so flip that sign in your head, bestie π₯
π SEE ALSO π
- Kernel file
./mm/memory-failure.c MF_ATTR_RO(9)get_hwpoison_page(9)mf_dax_kill_procs(9)memory_failure_pfn(9)memory_failure(9)memory_failure_queue(9)unpoison_memory(9)
the whole friend group fr fr π«Ά go read them, they're all part of the same lore.
and that's the page, bestie!! π this came to you from source ./mm and the date on it is October 2026 β so like, future-slay β¨π love that for us. now go soft offline responsibly, 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