__sk_mem_schedule(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– __sk_mem_schedule(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” this one's a little kernel function that bumps up sk_forward_alloc and memory_allocated on a socket. it's giving "quietly doing the most important bookkeeping in the room" energy, and honestly? iconic. πŸŽ€


✨ NAME ✨

__sk_mem_schedule β€” increase sk_forward_alloc and memory_allocated 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

int __sk_mem_schedule (struct sock *sk , int size , int kind );

like, that's the whole signature. short, sweet, slays. πŸ’…


🌸 ARGUMENTS 🌸

  • sk β€” the socket. the main character, fr fr. 🌟
  • size β€” the memory size to allocate. the amount we're out here claiming. πŸ’Έ
  • kind β€” the allocation type. this is the vibe check that decides which budget we're pulling from (see below, iykyk πŸ‘€).

⭐ DESCRIPTION ⭐

okay so here's the lore. if kind is SK_MEM_SEND, that means it's a wmem allocation. otherwise? it's an rmem allocation. them's the rules, no cap. 🧚

and listen β€” this function assumes that protocols which have memory_pressure use sk_wmem_queued as their write buffer accounting. like, it just assumes that. don't come for it if you didn't set that up, bestie. 😭 that's the contract, periodt.


🌈 SEE ALSO 🌈

the kernel file ./net/core/sock.c, plus the whole friend group:


πŸ’€ reminder: this page lives under ./net/core, from the Kernel API Manual, dated October 2026 β€” so like, go read the source too, bestie, and slay responsibly. πŸ«Άβœ¨πŸ“

k byeee, go allocate some memory (the right kind!!) πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from