Re: procfs and buffer calculation
Santhosh Raju <[email protected]> Sat, 11 Apr 2026 14:23:42 +0200
| Newsgroups | gmane.os.netbsd.current |
|---|---|
| Message-ID | <CACQjD2HK7SZZuhUE=1hgHqVvYuvVFh3_G9qrV_RMD2Y1daXtTg@mail.gmail.com> |
On Fri, Apr 10, 2026 at 8:33 PM Christos Zoulas <[email protected]> wrote: > > In article <CACQjD2E1Cz6=bTfXn0FT9F8V7iPXoxdHdAWMM_Q6yVE74duQ8Q@mail.gmail.com>, > Santhosh Raju <[email protected]> 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