Linux-mm Archive on
 help / color / Atom feed
From: "Matthew Wilcox (Oracle)" <>
To: Andrew Morton <>,
Cc: "Matthew Wilcox (Oracle)" <>
Subject: [PATCH] mm/debug: Improve memcg debugging
Date: Thu, 14 Jan 2021 19:02:00 +0000
Message-ID: <> (raw)

The memcg_data is only valid on the head page, not the tail pages.
Change the format and location of the printout within the dump to
match the other parts of struct page better.

Signed-off-by: Matthew Wilcox (Oracle) <>
 mm/debug.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/mm/debug.c b/mm/debug.c
index 8a40b3fefbeb..0bdda8407f71 100644
--- a/mm/debug.c
+++ b/mm/debug.c
@@ -110,6 +110,11 @@ void __dump_page(struct page *page, const char *reason)
+	if (head->memcg_data)
+		pr_warn("memcg:%lx\n", head->memcg_data);
 	if (PageKsm(page))
 		type = "ksm ";
 	else if (PageAnon(page))
@@ -180,11 +185,6 @@ void __dump_page(struct page *page, const char *reason)
 	if (reason)
 		pr_warn("page dumped because: %s\n", reason);
-	if (!page_poisoned && page->memcg_data)
-		pr_warn("pages's memcg:%lx\n", page->memcg_data);
 void dump_page(struct page *page, const char *reason)

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14 19:02 Matthew Wilcox (Oracle) [this message]
2021-01-15  2:19 ` Zi Yan

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:

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

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-mm Archive on

Archives are clonable:
	git clone --mirror linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ \
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone