linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xin Hao <xhao@linux.alibaba.com>
To: changbin.du@intel.com
Cc: sashal@kernel.org, akpm@linux-foundation.org,
	adobriyan@gmail.com, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, xhao@linux.alibaba.com
Subject: [PATCH] proc: export page young and skip_kasan_poison flag via kpageflags
Date: Thu,  2 Jun 2022 23:43:02 +0800	[thread overview]
Message-ID: <20220602154302.12634-1-xhao@linux.alibaba.com> (raw)

Now the young and skip_kasan_poison flag are supported in
show_page_flags(), but we can not get them from /proc/kpageflags,
So there add them.

Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
---
 fs/proc/page.c                    | 6 ++++++
 include/linux/kernel-page-flags.h | 2 ++
 tools/vm/page-types.c             | 4 ++++
 3 files changed, 12 insertions(+)

diff --git a/fs/proc/page.c b/fs/proc/page.c
index 9f1077d94cde..fd28e1d92c5c 100644
--- a/fs/proc/page.c
+++ b/fs/proc/page.c
@@ -220,6 +220,12 @@ u64 stable_page_flags(struct page *page)
 #ifdef CONFIG_64BIT
 	u |= kpf_copy_bit(k, KPF_ARCH_2,	PG_arch_2);
 #endif
+#if defined(CONFIG_PAGE_IDLE_FLAG) && defined(CONFIG_64BIT)
+	u |= kpf_copy_bit(k, KPF_YOUNG, PG_young);
+#endif
+#ifdef CONFIG_KASAN_HW_TAGS
+	u |= kpf_copy_bit(k, KPF_SKIP_KASAN_POSION, PG_skip_kasan_poison);
+#endif
 
 	return u;
 };
diff --git a/include/linux/kernel-page-flags.h b/include/linux/kernel-page-flags.h
index eee1877a354e..30aaa0ee4ca9 100644
--- a/include/linux/kernel-page-flags.h
+++ b/include/linux/kernel-page-flags.h
@@ -18,5 +18,7 @@
 #define KPF_UNCACHED		39
 #define KPF_SOFTDIRTY		40
 #define KPF_ARCH_2		41
+#define KPF_YOUNG		42
+#define KPF_SKIP_KASAN_POSION	43
 
 #endif /* LINUX_KERNEL_PAGE_FLAGS_H */
diff --git a/tools/vm/page-types.c b/tools/vm/page-types.c
index b1ed76d9a979..2671b746d11f 100644
--- a/tools/vm/page-types.c
+++ b/tools/vm/page-types.c
@@ -79,6 +79,8 @@
 #define KPF_UNCACHED		39
 #define KPF_SOFTDIRTY		40
 #define KPF_ARCH_2		41
+#define KPF_YOUNG		42
+#define KPF_SKIP_KASAN_POSION	43
 
 /* [48-] take some arbitrary free slots for expanding overloaded flags
  * not part of kernel API
@@ -137,6 +139,8 @@ static const char * const page_flag_names[] = {
 	[KPF_UNCACHED]		= "c:uncached",
 	[KPF_SOFTDIRTY]		= "f:softdirty",
 	[KPF_ARCH_2]		= "H:arch_2",
+	[KPF_YOUNG]		= "y:young",
+	[KPF_SKIP_KASAN_POSION]	= "K:skip_kasan_posion",
 
 	[KPF_READAHEAD]		= "I:readahead",
 	[KPF_SLOB_FREE]		= "P:slob_free",
-- 
2.31.0


             reply	other threads:[~2022-06-02 15:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02 15:43 Xin Hao [this message]
2022-06-02 18:04 ` [PATCH] proc: export page young and skip_kasan_poison flag via kpageflags Andrew Morton
2022-06-04  9:51   ` Xin Hao
2022-06-02 18:28 ` Matthew Wilcox
2022-06-04  9:50   ` Xin Hao
2022-06-04 15:08     ` Matthew Wilcox
2022-06-05  5:25       ` Xin Hao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220602154302.12634-1-xhao@linux.alibaba.com \
    --to=xhao@linux.alibaba.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=changbin.du@intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sashal@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).