Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: procfs and buffer calculation



On Fri, Apr 10, 2026 at 8:33 PM Christos Zoulas <christos%astron.com@localhost> wrote:
>
> In article <CACQjD2E1Cz6=bTfXn0FT9F8V7iPXoxdHdAWMM_Q6yVE74duQ8Q%mail.gmail.com@localhost>,
> Santhosh Raju  <fox%netbsd.org@localhost> wrote:
> >Hello
> >
> >I was recently working on making sysutils/py-psutil to be independent
> >of procfs being mounted, as part of a question raised in the PR[1], I
> >came across the buffers count implementation in procfs
> >- https://github.com/NetBSD/src/blob/trunk/sys/miscfs/procfs/procfs_linux.c#L203
> >
> >And it looks like the value passed in should be filepg and not freepg
> >
> >Line 195, shows filepg is what is being passed into buffers when
> >printing the stats out horizontally.
> >
> >Here is an example output
> >
> >$ cat /proc/meminfo
> >        total:    used:    free:  shared: buffers: cached:
> >Mem:  8301424640 8194068480 107356160        0 1378316288 7050772480
> >Swap: 4294926336 3880894464 414031872
> >MemTotal:   8106860 kB
> >MemFree:     104840 kB
> >MemShared:        0 kB
> >Buffers:     104840 kB
> >Cached:     6885520 kB
> >SwapTotal:  4194264 kB
> >SwapFree:    404328 kB
> >
> >Happy to make the change and do the commit, if there are no objections to it.
> >
> >Reference
> >1. https://github.com/giampaolo/psutil/pull/2805#discussion_r3048247572
>
> Sure, go for it.
>

Done. Thank you!

--
Santhosh


Home | Main Index | Thread Index | Old Index