nfsd_stats_d...em_usage_add(9)
π 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:
nfsd_stats_rc_hits_inc(9)nfsd_stats_rc_misses_inc(9)nfsd_stats_rc_nocache_inc(9)nfsd_stats_io_read_add(9)nfsd_stats_io_write_add(9)nfsd_stats_drc_mem_usage_sub(9)
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
- 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