Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2010-10-07 14:57:45 +0200
committerMichal Marek <mmarek@suse.cz>2010-10-07 14:57:45 +0200
commitd0a1a23cbf7fceee4b09ff14ffaecc62118ff8d3 (patch)
tree62338c3840fbf30d410fd743ce4bbd94cb0c955a
parent34406e22a2fd8ad6486f5de09d0f01306fe28dad (diff)
parentfb209dddae353c991eb4d26b30773f56d1ac6c1d (diff)
Merge branch 'SLE11-SP1' of kerncvs:/home/git/kernel-source into SLE11-SP1rpm-2.6.32.23-0.3
-rw-r--r--kernel-source.changes7
-rw-r--r--patches.fixes/proc-pid-smaps-export-amount-of-anonymous-memory-in-a-mapping.patch65
-rw-r--r--series.conf2
3 files changed, 74 insertions, 0 deletions
diff --git a/kernel-source.changes b/kernel-source.changes
index fcf5bc64e4..64cc3cbe5d 100644
--- a/kernel-source.changes
+++ b/kernel-source.changes
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Thu Oct 7 14:43:24 CEST 2010 - knikanth@suse.de
+
+- patches.fixes/proc-pid-smaps-export-amount-of-anonymous-memory-in-a-mapping.patch:
+ Export the number of anonymous pages in a mapping via smaps
+ (bnc#596646).
+
+-------------------------------------------------------------------
Thu Oct 7 14:10:37 CEST 2010 - mmarek@suse.de
- Import new s390x kabi files.
diff --git a/patches.fixes/proc-pid-smaps-export-amount-of-anonymous-memory-in-a-mapping.patch b/patches.fixes/proc-pid-smaps-export-amount-of-anonymous-memory-in-a-mapping.patch
new file mode 100644
index 0000000000..09719ae6a0
--- /dev/null
+++ b/patches.fixes/proc-pid-smaps-export-amount-of-anonymous-memory-in-a-mapping.patch
@@ -0,0 +1,65 @@
+From: Nikanth Karthikesan <knikanth@suse.de>
+Subject: Export the number of anonymous pages in a mapping via smaps.
+Patch-mainline: In -mm tree since 17 Sep 2010. http://userweb.kernel.org/~akpm/mmotm/broken-out/proc-pid-smaps-export-amount-of-anonymous-memory-in-a-mapping.patch
+References: bnc#596646
+
+
+Export the number of anonymous pages in a mapping via smaps.
+
+Even the private pages in a mapping backed by a file, would be marked as
+anonymous, when they are modified. Export this information to user-space via
+smaps.
+
+Exporting this count will help gdb to make a better decision on which
+areas need to be dumped in its coredump; and should be useful to others
+studying the memory usage of a process.
+
+Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
+Acked-by: Hugh Dickins <hughd@google.com>
+Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
+Cc: Matt Mackall <mpm@selenic.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+
+---
+
+ fs/proc/task_mmu.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+Index: linux-2.6.32-SLE11-SP1/fs/proc/task_mmu.c
+===================================================================
+--- linux-2.6.32-SLE11-SP1.orig/fs/proc/task_mmu.c
++++ linux-2.6.32-SLE11-SP1/fs/proc/task_mmu.c
+@@ -322,6 +322,7 @@ struct mem_size_stats {
+ unsigned long private_clean;
+ unsigned long private_dirty;
+ unsigned long referenced;
++ unsigned long anonymous;
+ unsigned long swap;
+ u64 pss;
+ };
+@@ -354,6 +355,9 @@ static int smaps_pte_range(pmd_t *pmd, u
+ if (!page)
+ continue;
+
++ if (PageAnon(page))
++ mss->anonymous += PAGE_SIZE;
++
+ /* Accumulate the size in pages that have been accessed. */
+ if (pte_young(ptent) || PageReferenced(page))
+ mss->referenced += PAGE_SIZE;
+@@ -405,6 +409,7 @@ static int show_smap(struct seq_file *m,
+ "Private_Clean: %8lu kB\n"
+ "Private_Dirty: %8lu kB\n"
+ "Referenced: %8lu kB\n"
++ "Anonymous: %8lu kB\n"
+ "Swap: %8lu kB\n"
+ "KernelPageSize: %8lu kB\n"
+ "MMUPageSize: %8lu kB\n",
+@@ -416,6 +421,7 @@ static int show_smap(struct seq_file *m,
+ mss.private_clean >> 10,
+ mss.private_dirty >> 10,
+ mss.referenced >> 10,
++ mss.anonymous >> 10,
+ mss.swap >> 10,
+ vma_kernel_pagesize(vma) >> 10,
+ vma_mmu_pagesize(vma) >> 10);
diff --git a/series.conf b/series.conf
index 6e65364ab2..a85a868017 100644
--- a/series.conf
+++ b/series.conf
@@ -657,6 +657,8 @@
patches.fixes/mempolicy-fix-get_mempolicy-for-relative-and-static-nodes.patch
patches.fixes/mm-independent-rr-slab.patch
+ patches.fixes/proc-pid-smaps-export-amount-of-anonymous-memory-in-a-mapping.patch
+
########################################################
# IPC patches
########################################################