mem_cgroup_sk_charge(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– mem_cgroup_sk_charge β€” socket-memory charging, bestie πŸ’–

okay so welcome to the mem_cgroup_sk_charge(9) page from the Kernel API Manual β€” this is the lil function that handles charging socket memory, and yes it's giving kernel-internals main character energy. 🫢


✨ NAME ✨

mem_cgroup_sk_charge β€” charge socket memory. That's the whole vibe: socket memory gets charged. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

bool mem_cgroup_sk_charge (const struct sock *sk , unsigned int nr_pages
, gfp_t gfp_mask );

πŸŽ€ ARGUMENTS πŸŽ€

  • sk β€” socket in memcg to charge. This is the socket getting its memcg moment. ✨
  • nr_pages β€” number of pages to charge. Literally the page count, no cap.
  • gfp_mask β€” reclaim mode. Keep it exactly as reclaim mode, bestie.

πŸ’… DESCRIPTION πŸ’…

Charges nr_pages to memcg. Then it returns true if the charge fit within memcg's configured limit, and false if it doesn't. That's the tea. πŸ“


πŸ‘€ SEE ALSO πŸ‘€

Kernel file ./mm/memcontrol.c β€” go peek, iykyk.


okay that's the page, bestie! source/version ./mm, dated October 2026, from the mem_cgroup_sk_charge(9) manual β€” mwah πŸ’‹πŸ«Ά

πŸ“¦ where this page comes from