mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
mm, proc: add KReclaimable to /proc/meminfo
The vmstat NR_KERNEL_MISC_RECLAIMABLE counter is for kernel non-slab allocations that can be reclaimed via shrinker. In /proc/meminfo, we can show the sum of all reclaimable kernel allocations (including slab) as "KReclaimable". Add the same counter also to per-node meminfo under /sys With this counter, users will have more complete information about kernel memory usage. Non-slab reclaimable pages (currently just the ION allocator) will not be missing from /proc/meminfo, making users wonder where part of their memory went. More precisely, they already appear in MemAvailable, but without the new counter, it's not obvious why the value in MemAvailable doesn't fully correspond with the sum of other counters participating in it. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Vlastimil Babka <[email protected]> Acked-by: Roman Gushchin <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: David Rientjes <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: Laura Abbott <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Sumit Semwal <[email protected]> Cc: Vijayanand Jitta <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
b29940c1ab
commit
61f94e18de
3 changed files with 24 additions and 15 deletions
|
|
@ -38,6 +38,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
|
|||
long cached;
|
||||
long available;
|
||||
unsigned long pages[NR_LRU_LISTS];
|
||||
unsigned long sreclaimable, sunreclaim;
|
||||
int lru;
|
||||
|
||||
si_meminfo(&i);
|
||||
|
|
@ -53,6 +54,8 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
|
|||
pages[lru] = global_node_page_state(NR_LRU_BASE + lru);
|
||||
|
||||
available = si_mem_available();
|
||||
sreclaimable = global_node_page_state(NR_SLAB_RECLAIMABLE);
|
||||
sunreclaim = global_node_page_state(NR_SLAB_UNRECLAIMABLE);
|
||||
|
||||
show_val_kb(m, "MemTotal: ", i.totalram);
|
||||
show_val_kb(m, "MemFree: ", i.freeram);
|
||||
|
|
@ -94,14 +97,11 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
|
|||
show_val_kb(m, "Mapped: ",
|
||||
global_node_page_state(NR_FILE_MAPPED));
|
||||
show_val_kb(m, "Shmem: ", i.sharedram);
|
||||
show_val_kb(m, "Slab: ",
|
||||
global_node_page_state(NR_SLAB_RECLAIMABLE) +
|
||||
global_node_page_state(NR_SLAB_UNRECLAIMABLE));
|
||||
|
||||
show_val_kb(m, "SReclaimable: ",
|
||||
global_node_page_state(NR_SLAB_RECLAIMABLE));
|
||||
show_val_kb(m, "SUnreclaim: ",
|
||||
global_node_page_state(NR_SLAB_UNRECLAIMABLE));
|
||||
show_val_kb(m, "KReclaimable: ", sreclaimable +
|
||||
global_node_page_state(NR_KERNEL_MISC_RECLAIMABLE));
|
||||
show_val_kb(m, "Slab: ", sreclaimable + sunreclaim);
|
||||
show_val_kb(m, "SReclaimable: ", sreclaimable);
|
||||
show_val_kb(m, "SUnreclaim: ", sunreclaim);
|
||||
seq_printf(m, "KernelStack: %8lu kB\n",
|
||||
global_zone_page_state(NR_KERNEL_STACK_KB));
|
||||
show_val_kb(m, "PageTables: ",
|
||||
|
|
|
|||
Loading…
Reference in a new issue