nfsd_stats_d...em_usage_add(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… nfsd_stats_drc_mem_usage_add(9) β€” like, the Kernel API Manual but make it make sense ✨

okay bestie, so this one lives in the Kernel API Manual and it's genuinely such a tiny little function but it's lowkey doing something cute with memory accounting, so let's get into it 🫢


🌸 NAME 🌸

nfsd_stats_drc_mem_usage_add β€” adds up the memory that a cache item is eating. that's it, that's the vibe πŸ’–


✨ SYNOPSIS ✨

void nfsd_stats_drc_mem_usage_add (struct nfsd_net *nn , s64 amount );

no cap, that's the whole signature. void return, so nothing comes back out β€” she just does her thing and dips πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • nn β€” the target network namespace, like the little world this is all happening inside 🌈
  • amount β€” byte count. literally just how many bytes we're adding to the tally πŸ“

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: percpu_counter_add_local keeps all the updates chillin' on the per-CPU fast path. very main character, very low-effort, high-reward ✨

and the sole reader β€” that's percpu_counter_sum_positive β€” sums up all the per-CPU deltas. so batching locally? it does not lose accuracy. not even a little. fr fr, the numbers stay correct πŸ˜ŒπŸ‘‘

like, the way that local batching stays accurate because the only reader adds the per-CPU deltas back together β€” it's giving designed-with-intention πŸ’œ

πŸ”₯ SEE ALSO πŸ”₯

y'all should also peek at the kernel file ./fs/nfsd/stats.h and these iconics:

go read them, iykyk 🌸


and that's the whole page, bestie β€” this one's stamped from ./fs/nfsd, dated October 2026, and it's been a pleasure doing stats with you πŸ§šπŸ’– periodt.

πŸ“¦ where this page comes from