__sk_mem_schedule(9)
π __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:
sk_ns_capable(9)sk_capable(9)sk_net_capable(9)sk_set_memalloc(9)sk_alloc(9)sk_clone(9)skb_page_frag_refill(9)sk_wait_data(9)__sk_mem_raise_allocated(9)__sk_mem_reduce_allocated(9)__sk_mem_reclaim(9)
π 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
- 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