swapin_sync(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… swapin_sync(9) β€” Kernel API Manual

okay bestie, welcome to swapin_sync(9) ✨ this one lives in the kernel API manual and it's literally the girl who pulls one swap entry β€” or a whole little squad of them β€” back in, and she does it without the readahead. no extras, no surprise guests, just the pages you actually asked for. πŸ’–


πŸ¦‹ SYNOPSIS

struct folio * swapin_sync (swp_entry_t entry , gfp_t gfp , unsigned long orders , struct vm_fault *vmf , struct mempolicy *mpol , pgoff_t ilx );

🌸 ARGUMENTS

  • entry β€” the swap entry that points at the target slot. this is the thing you're saying "hey, bring this one back" about πŸŽ€
  • gfp β€” the memory allocation flags, aka the vibe check for how the allocation is allowed to behave.
  • orders β€” the allocation orders. plural, babes, we can go big.
  • vmf β€” the fault information. the lore, if you will.
  • mpol β€” the NUMA memory allocation policy that gets applied.
  • ilx β€” the NUMA interleave index. ⚠️ for use only when MPOL_INTERLEAVE β€” don't be out here using it any other time, iykyk.

✨ DESCRIPTION

so here's the tea β˜•: this allocates a folio that's suitable for the given orders, or it hands you back the existing folio that's already sitting in the swap cache for entry. whichever one applies, no cap.

it also kicks off the IO if that's needed β€” she's proactive like that, main character energy πŸ”₯

and one iconic detail: entry gets rounded down if orders allow a large allocation. the way that just happens for you… periodt. πŸ’…


πŸ‘‘ CONTEXT

🚨 bestie listen to me: the caller must ensure entry is valid, and must pin the swap device with a refcount. non-negotiable, fr fr. do not skip this step. πŸ™ˆ

⭐ RETURN

returns the folio on success β€” slay πŸŽ‰ β€” or an error code if it failed 😭.


πŸ”₯ SEE ALSO

kernel file ./mm/swap_state.c, plus the whole friend group:


🫢 and that's the whole page, bestie β€” brought to you from ./mm, dated October 2026. go forth and swap in sync, mwah πŸ’‹πŸŒˆ

πŸ“¦ where this page comes from