mm: oom analysis: add shmem vmstat

Recently we encountered OOM problems due to memory use of the GEM cache.
Generally a large amuont of Shmem/Tmpfs pages tend to create a memory
shortage problem.

We often use the following calculation to determine the amount of shmem
pages:

shmem = NR_ACTIVE_ANON + NR_INACTIVE_ANON - NR_ANON_PAGES

however the expression does not consider isolated and mlocked pages.

This patch adds explicit accounting for pages used by shmem and tmpfs.

Signed-off-by: KOSAKI Motohiro <[email protected]>
Acked-by: Rik van Riel <[email protected]>
Reviewed-by: Christoph Lameter <[email protected]>
Acked-by: Wu Fengguang <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Hugh Dickins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
KOSAKI Motohiro 2009-09-21 17:01:33 -07:00 • committed by Linus Torvalds
commit 4b02108ac1
7 changed files with 18 additions and 3 deletions

View file

@ -644,7 +644,7 @@ static const char * const vmstat_text[] = {
"nr_bounce",
"nr_vmscan_write",
"nr_writeback_temp",
"nr_shmem",
#ifdef CONFIG_NUMA
"numa_hit",
"numa_miss",