page_counter_charge(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– page_counter_charge(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” yes we're reading kernel docs together, this is our bonding time now 🫢. Today's main character is page_counter_charge(9), and honestly? she's a queen. πŸ‘‘


✨ NAME ✨

page_counter_charge β€” hierarchically charge pages 🌸

like, she charges pages hierarchically, iykyk. the hierarchy is doing the heavy lifting here, no cap.


✨ SYNOPSIS ✨

void page_counter_charge (struct page_counter *counter , unsigned long nr_pages );

that's the whole vibe. void return, so she doesn't even tell you how it went β€” she just does it. πŸ’…


✨ ARGUMENTS ✨

  • counter β€” a counter. that's it. that's the argument. the original docs said "counter" and honestly? same. it's a struct page_counter * and that's the whole description, bestie 😭
  • nr_pages β€” number of pages to charge πŸ”₯ literally how many pages you're putting on the tab.

✨ NOTE ✨

⚠️ big heads up: this does not consider any configured counter limits. none. zero. she does not check the limits, she does not care about the limits, she is simply charging. so if you were expecting her to stop you β€” she won't πŸ™ˆ

✨ SEE ALSO ✨

all the siblings and cousins, found over in the kernel file ./mm/page_counter.c πŸ¦‹:

go read them all, they ate πŸ’…βœ¨


aaaand that's the page!! πŸŽ€ this little love letter lives in ./mm, dated October 2026, and it's giving "kernel internals but make it cute" πŸŒˆπŸ’œ so long bestie, go charge some pages responsibly πŸ§šβ€β™€οΈβœ¨

πŸ“¦ where this page comes from