__sk_mem_reduce_allocated(9)
πΈ __sk_mem_reduce_allocated(9) πΈ
okay so bestie, welcome to the Kernel API Manual β we're doing a little memory accounting today and honestly it's giving bookkeeping-but-make-it-chaotic β¨
πΈ NAME πΈ
__sk_mem_reduce_allocated β reclaim memory_allocated
like, the whole job is give the memory back π«Ά
π SYNOPSIS π
void __sk_mem_reduce_allocated (struct sock *sk , int amount );
no cap, that's the whole signature. short and iconic π
π¦ ARGUMENTS π¦
skβ socket. the little guy whose memory situation we're adjusting πamountβ number of quanta. yes, quanta. plural of quantum. physics-adjacent. we love to see it β
π DESCRIPTION π
Bestie, listen. This one is Similar to __sk_mem_reclaim, but β and this is the whole entire lore β it does not update sk_forward_alloc. That's it. That's the difference. The way that one missing update changes everything π
So if you were expecting sk_forward_alloc to get touched? It does not. Not here. Not today. Read the reclaim one for that, iykyk.
fr fr, don't assume this updates sk_forward_alloc β the manpage is so clear about it and we're not gonna pretend otherwise π
π SEE ALSO π
Kernel file ./net/core/sock.c β the source of truth, the main character π
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)β the raise one, the opposite vibe π₯__sk_mem_schedule(9)__sk_mem_reclaim(9)β the sibling that DOES touchsk_forward_alloc, go read that one next π§
and that's the teardown, bestie π this page lives in ./net/core and it's dated October 2026, from the Kernel API Manual β slay, periodt, go reduce some allocated memory π
β¨π
π¦ 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