linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC] mm:add KPF_ZERO_PAGE flag for /proc/kpageflags
@ 2014-12-05  8:57 Wang, Yalin
  2014-12-05  9:20 ` Konstantin Khlebnikov
       [not found] ` <35FD53F367049845BC99AC72306C23D103E688B313F1@CNBJMBX05.corpusers.net>
  0 siblings, 2 replies; 20+ messages in thread
From: Wang, Yalin @ 2014-12-05  8:57 UTC (permalink / raw)
  To: linux-arm-kernel

This patch add KPF_ZERO_PAGE flag for zero_page,
so that userspace process can notice zero_page from
/proc/kpageflags, and then do memory analysis more accurately.

Signed-off-by: Yalin Wang <yalin.wang@sonymobile.com>
---
 fs/proc/page.c                         | 3 +++
 include/uapi/linux/kernel-page-flags.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/fs/proc/page.c b/fs/proc/page.c
index 1e3187d..120dbf7 100644
--- a/fs/proc/page.c
+++ b/fs/proc/page.c
@@ -136,6 +136,9 @@ u64 stable_page_flags(struct page *page)
 	if (PageBalloon(page))
 		u |= 1 << KPF_BALLOON;
 
+	if (is_zero_pfn(page_to_pfn(page)))
+		u |= 1 << KPF_ZERO_PAGE;
+
 	u |= kpf_copy_bit(k, KPF_LOCKED,	PG_locked);
 
 	u |= kpf_copy_bit(k, KPF_SLAB,		PG_slab);
diff --git a/include/uapi/linux/kernel-page-flags.h b/include/uapi/linux/kernel-page-flags.h
index 2f96d23..a6c4962 100644
--- a/include/uapi/linux/kernel-page-flags.h
+++ b/include/uapi/linux/kernel-page-flags.h
@@ -32,6 +32,7 @@
 #define KPF_KSM			21
 #define KPF_THP			22
 #define KPF_BALLOON		23
+#define KPF_ZERO_PAGE		24
 
 
 #endif /* _UAPILINUX_KERNEL_PAGE_FLAGS_H */
-- 
2.1.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2015-01-11  8:23 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-05  8:57 [RFC] mm:add KPF_ZERO_PAGE flag for /proc/kpageflags Wang, Yalin
2014-12-05  9:20 ` Konstantin Khlebnikov
2014-12-05 10:22   ` Wang, Yalin
2014-12-05 22:31     ` Andrew Morton
     [not found]       ` <35FD53F367049845BC99AC72306C23D103E688B313F4@CNBJMBX05.corpusers.net>
2014-12-08 11:46         ` [RFC V4] " Kirill A. Shutemov
     [not found]           ` <35FD53F367049845BC99AC72306C23D103E688B313FB@CNBJMBX05.corpusers.net>
     [not found]             ` <35FD53F367049845BC99AC72306C23D103E688B31403@CNBJMBX05.corpusers.net>
2014-12-10 11:05               ` [RFC] mm:fix zero_page huge_zero_page rss/pss statistic Kirill A. Shutemov
2014-12-12  1:59                 ` Wang, Yalin
2014-12-12 11:10                   ` Kirill A. Shutemov
2014-12-10 17:06             ` [RFC V5] mm:add KPF_ZERO_PAGE flag for /proc/kpageflags Konstantin Khlebnikov
     [not found]               ` <35FD53F367049845BC99AC72306C23D103E688B31408@CNBJMBX05.corpusers.net>
     [not found]                 ` <35FD53F367049845BC99AC72306C23D103EDAF89E14C@CNBJMBX05.corpusers.net>
2014-12-19  1:04                   ` [RFC] MADV_FREE doesn't work when doesn't have swap partition Minchan Kim
2014-12-19  6:54                     ` Wang, Yalin
2014-12-22 10:30                     ` Konstantin Khlebnikov
     [not found]                   ` <35FD53F367049845BC99AC72306C23D103EDAF89E160@CNBJMBX05.corpusers.net>
2015-01-07  0:43                     ` [RFC] mm:change meminfo cached calculation Andrew Morton
2015-01-07  1:04                       ` Hugh Dickins
2015-01-07  1:25                         ` Andrew Morton
2015-01-07  2:03                           ` Hugh Dickins
2015-01-11  8:23                             ` Konstantin Khlebnikov
     [not found] ` <35FD53F367049845BC99AC72306C23D103E688B313F1@CNBJMBX05.corpusers.net>
2014-12-05 11:05   ` [RFC V2] mm:add KPF_ZERO_PAGE flag for /proc/kpageflags Kirill A. Shutemov
2014-12-08  7:47   ` [PATCH] mm:add VM_BUG_ON() for page_mapcount() Wang, Yalin
2014-12-08 11:50     ` Kirill A. Shutemov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).