linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Huangzhaoyang <huangzhaoyang@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Zhaoyang Huang <zhaoyang.huang@unisoc.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] mm: record context on page->mapping
Date: Thu, 10 Feb 2022 13:18:17 +0000	[thread overview]
Message-ID: <YgUQmYy2Tl5oYkqz@casper.infradead.org> (raw)
In-Reply-To: <1644483715-7981-1-git-send-email-huangzhaoyang@gmail.com>

On Thu, Feb 10, 2022 at 05:01:55PM +0800, Huangzhaoyang wrote:
> 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;
>  }

You didn't actually try this patch, did you?  See page_expected_state().
Or, I don't know, just boot it.


      parent reply	other threads:[~2022-02-10 13:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10  9:01 Huangzhaoyang
2022-02-10 10:00 ` Zhaoyang Huang
2022-02-10 13:18 ` Matthew Wilcox [this message]

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=YgUQmYy2Tl5oYkqz@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=huangzhaoyang@gmail.com \
    --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