Further info on underflow in /proc/meminfo

Denis Vlasenko (vda@port.imtp.ilyichevsk.odessa.ua)
Thu, 26 Sep 2002 15:30:29 -0200


This is roughly how it is generated:
...
struct sysinfo i;
...
si_meminfo(&i);
val->bufferram = atomic_read(&buffermem_pages);
...
pg_size = atomic_read(&page_cache_size) - i.bufferram;
...
sprintf("cached: %d",B(pg_size));
...

On my box I have:

# cat /proc/meminfo
total: used: free: shared: buffers: cached:
Mem: 30322688 27533312 2789376 0 19501056 18446744073699565568
Swap: 100655104 8732672 91922432 ^^^^^^^^^^^^^^^^^^^^
MemTotal: 29612 kB
...

so, page_cache_size-buffermem_pages<0 and after it got scaled pages->bytes
we have LARGE "cached:" value! :-)

# uname -a
Linux pegasus 2.4.18-pre6mhv_ll #2 SMP Wed Mar 27 11:17:36 GMT+2 2002 i686 unknown

--
vda
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/