aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/node.c
diff options
context:
space:
mode:
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>2009-09-21 20:01:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-22 10:17:27 -0400
commitc6a7f5728a1db45d30df55a01adc130b4ab0327c (patch)
tree36649bc6ebb959841a5097c699968722cfd99c4d /drivers/base/node.c
parent71de1ccbe1fb40203edd3beb473f8580d917d2ca (diff)
mm: oom analysis: Show kernel stack usage in /proc/meminfo and OOM log output
The amount of memory allocated to kernel stacks can become significant and cause OOM conditions. However, we do not display the amount of memory consumed by stacks. Add code to display the amount of memory used for stacks in /proc/meminfo. Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Reviewed-by: Christoph Lameter <cl@linux-foundation.org> Reviewed-by: Minchan Kim <minchan.kim@gmail.com> Reviewed-by: Rik van Riel <riel@redhat.com> Cc: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/base/node.c')
-rw-r--r--drivers/base/node.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 91d4087b4039..b560c17f6d4e 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -85,6 +85,7 @@ static ssize_t node_read_meminfo(struct sys_device * dev,
85 "Node %d FilePages: %8lu kB\n" 85 "Node %d FilePages: %8lu kB\n"
86 "Node %d Mapped: %8lu kB\n" 86 "Node %d Mapped: %8lu kB\n"
87 "Node %d AnonPages: %8lu kB\n" 87 "Node %d AnonPages: %8lu kB\n"
88 "Node %d KernelStack: %8lu kB\n"
88 "Node %d PageTables: %8lu kB\n" 89 "Node %d PageTables: %8lu kB\n"
89 "Node %d NFS_Unstable: %8lu kB\n" 90 "Node %d NFS_Unstable: %8lu kB\n"
90 "Node %d Bounce: %8lu kB\n" 91 "Node %d Bounce: %8lu kB\n"
@@ -116,6 +117,8 @@ static ssize_t node_read_meminfo(struct sys_device * dev,
116 nid, K(node_page_state(nid, NR_FILE_PAGES)), 117 nid, K(node_page_state(nid, NR_FILE_PAGES)),
117 nid, K(node_page_state(nid, NR_FILE_MAPPED)), 118 nid, K(node_page_state(nid, NR_FILE_MAPPED)),
118 nid, K(node_page_state(nid, NR_ANON_PAGES)), 119 nid, K(node_page_state(nid, NR_ANON_PAGES)),
120 nid, node_page_state(nid, NR_KERNEL_STACK) *
121 THREAD_SIZE / 1024,
119 nid, K(node_page_state(nid, NR_PAGETABLE)), 122 nid, K(node_page_state(nid, NR_PAGETABLE)),
120 nid, K(node_page_state(nid, NR_UNSTABLE_NFS)), 123 nid, K(node_page_state(nid, NR_UNSTABLE_NFS)),
121 nid, K(node_page_state(nid, NR_BOUNCE)), 124 nid, K(node_page_state(nid, NR_BOUNCE)),