[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <35FD53F367049845BC99AC72306C23D1044A02027E04@CNBJMBX05.corpusers.net>
Date: Fri, 30 Jan 2015 14:14:30 +0800
From: "Wang, Yalin" <Yalin.Wang@...ymobile.com>
To: "'akpm@...ux-foundation.org'" <akpm@...ux-foundation.org>,
"'kirill.shutemov@...ux.intel.com'" <kirill.shutemov@...ux.intel.com>,
"'oleg@...hat.com'" <oleg@...hat.com>,
"'gorcunov@...nvz.org'" <gorcunov@...nvz.org>,
"'n-horiguchi@...jp.nec.com'" <n-horiguchi@...jp.nec.com>,
"'pfeiner@...gle.com'" <pfeiner@...gle.com>,
"'aquini@...hat.com'" <aquini@...hat.com>,
"'linux-kernel@...r.kernel.org'" <linux-kernel@...r.kernel.org>
Subject: [RFC] mm:change /proc/smaps caculation behavior
This patch change smaps pagetable walk behavior, to make
sure not skip VM_PFNMAP pagetables,
so that we can calculate COW pages of VM_PFNMAP as normal pages.
Signed-off-by: Yalin Wang <yalin.wang@...ymobile.com>
---
fs/proc/task_mmu.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index c7267e9..00a5b73 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -503,6 +503,15 @@ static void smaps_pte_entry(pte_t *pte, unsigned long addr,
smaps_account(mss, page, PAGE_SIZE, pte_young(*pte), pte_dirty(*pte));
}
+static int smaps_test_walk(unsigned long addr, unsigned long next,
+ struct mm_walk *walk)
+{
+ /*
+ * don't skip VM_PFNMAP, so that we can caculate some COW pages.
+ */
+ return 0;
+}
+
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
static void smaps_pmd_entry(pmd_t *pmd, unsigned long addr,
struct mm_walk *walk)
@@ -616,6 +625,7 @@ static int show_smap(struct seq_file *m, void *v, int is_pid)
struct mem_size_stats mss;
struct mm_walk smaps_walk = {
.pmd_entry = smaps_pte_range,
+ .test_walk = smaps_test_walk,
.mm = vma->vm_mm,
.private = &mss,
};
--
2.2.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists