From: Huangzhaoyang <huangzhaoyang@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Zhaoyang Huang <zhaoyang.huang@unisoc.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [RFC PATCH] mm: record context on page->mapping
Date: Thu, 10 Feb 2022 17:01:55 +0800 [thread overview]
Message-ID: <1644483715-7981-1-git-send-email-huangzhaoyang@gmail.com> (raw)
From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
Since page->mapping is vacant in the pages which used by kernel(drivers etc)
Have it record current context to help tracking the page's owner in system
memory dump.
Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
---
mm/page_alloc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index c595274..2757d10 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2430,6 +2430,8 @@ static void prep_new_page(struct page *page, unsigned int order, gfp_t gfp_flags
set_page_pfmemalloc(page);
else
clear_page_pfmemalloc(page);
+
+ page->mapping = (struct address_space *)current;
}
/*
--
1.9.1
next reply other threads:[~2022-02-10 9:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-10 9:01 Huangzhaoyang [this message]
2022-02-10 10:00 ` [RFC PATCH] mm: record context on page->mapping Zhaoyang Huang
2022-02-10 13:18 ` Matthew Wilcox
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=1644483715-7981-1-git-send-email-huangzhaoyang@gmail.com \
--to=huangzhaoyang@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=zhaoyang.huang@unisoc.com \
/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).