soft_offline_page(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 as memory_failure uses. 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 when hwpoison_filter filtered 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 πŸ‘‘

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