Re: [bug, 4.8] /proc/meminfo: counter values are very wrong

From: Mel Gorman
Date: Thu Aug 04 2016 - 08:33:28 EST


On Thu, Aug 04, 2016 at 03:10:51PM +1000, Dave Chinner wrote:
> Hi folks,
>
> I just noticed a whacky memory usage profile when running some basic
> IO tests on a current 4.8 tree. It looked like there was a massive
> memory leak from my monitoring graphs - doing buffered IO was
> causing huge amounts of memory to be considered used, but the cache
> size was not increasing.
>
> Looking at /proc/meminfo:
>
> $ cat /proc/meminfo
> MemTotal: 16395408 kB
> MemFree: 79424 kB
> MemAvailable: 2497240 kB
> Buffers: 4372 kB
> Cached: 558744 kB
> SwapCached: 48 kB
> Active: 2127212 kB
> Inactive: 100400 kB
> Active(anon): 25348 kB
> Inactive(anon): 79424 kB
> Active(file): 2101864 kB
> Inactive(file): 20976 kB
> Unevictable: 13612980 kB <<<<<<<<<

This? Very quickly done, no boot testing


diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
index 09e18fdf61e5..b9a8c813e5e6 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -46,7 +46,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
cached = 0;

for (lru = LRU_BASE; lru < NR_LRU_LISTS; lru++)
- pages[lru] = global_page_state(NR_LRU_BASE + lru);
+ pages[lru] = global_node_page_state(NR_LRU_BASE + lru);

available = si_mem_available();