softleaf_en...it_on_locked(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– softleaf_entry_wait_on_locked(9) β€” the kernel API manual, but make it make sense πŸ’–

okay so bestie, pull up a chair, because we're reading a kernel API manual page together and honestly? it's giving "waiting room energy" but in the good way. this is the softleaf_en...it_on_locked(9) page (yes the header truncates it like that, the kernel is dramatic πŸ’…), from the Kernel API Manual.


✨ NAME ✨

softleaf_entry_wait_on_locked β€” literally just: wait for a migration entry or a device_private entry to be removed. that's the whole vibe. it waits. it's patient. main character energy πŸ•°οΈ


🌸 SYNOPSIS 🌸

void softleaf_entry_wait_on_locked (softleaf_t entry , spinlock_t *ptl
);

yep that's the signature, copy it exactly, no cap 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • entry β€” a migration swap entry or a device_private swap entry. that's the thing we're waiting on, bestie.
  • ptl β€” an already locked ptl. heads up: this function will drop the lock. it takes the lock from your hands and lets go of it, so don't go assuming you still hold it after, okay? 😭

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea β˜•: this function waits for a migration entry that references the given page, or a device_private entry that references a dvice_private page (and yes, that's literally how it's spelled in the original β€” we don't fix, we report πŸ™ˆ), to be unlocked.

It is equivalent to:

folio_put_wait_locked(folio, TASK_UNINTERRUPTIBLE)

...with one iconic little difference: this one can be called without taking a reference on the page. obsessed. instead, you should call it while holding the ptl for the entry that references the page. that's the whole trick ✨

It returns after unlocking the ptl. so like, the unlock already happened by the time you get control back. not me warning you twice πŸ’€

It follows the same logic as folio_wait_bit_common, so if you want the deep lore, go read the comments there. iykyk πŸ“–


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./mm/filemap.c, plus this whole friend group right here β€” every single one, no skips:


🌈 quick reminder bestie: ptl comes in locked, and this function drops it. that's not a bug, that's the whole bit. don't double-unlock, don't touch it after. periodt πŸ’…

and that's the page!! πŸ’œ source is ./mm, dated October 2026, and it lives in the Kernel API Manual β€” go forth, wait on your locked entries responsibly, and slay πŸ§šβ€β™€οΈβœ¨πŸŒΈ

πŸ“¦ where this page comes from