linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zi Yan <ziy@nvidia.com>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>, <linux-mm@kvack.org>
Subject: Re: [PATCH] mm/debug: Improve memcg debugging
Date: Thu, 14 Jan 2021 21:19:52 -0500	[thread overview]
Message-ID: <7E6A4334-D1D0-4FBC-93EE-185B7A87992D@nvidia.com> (raw)
In-Reply-To: <20210114190200.1894484-1-willy@infradead.org>

[-- Attachment #1: Type: text/plain, Size: 1308 bytes --]

On 14 Jan 2021, at 14:02, Matthew Wilcox (Oracle) wrote:

> 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) <willy@infradead.org>
> ---
>  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)
>  					head_compound_mapcount(head));
>  		}
>  	}
> +
> +#ifdef CONFIG_MEMCG
> +	if (head->memcg_data)
> +		pr_warn("memcg:%lx\n", head->memcg_data);
> +#endif
>  	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);
> -
> -#ifdef CONFIG_MEMCG
> -	if (!page_poisoned && page->memcg_data)
> -		pr_warn("pages's memcg:%lx\n", page->memcg_data);
> -#endif
>  }
>
>  void dump_page(struct page *page, const char *reason)
> -- 
> 2.29.2

LGTM. Reviewed-by: Zi Yan <ziy@nvidia.com>

—
Best Regards,
Yan Zi

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 854 bytes --]

      reply	other threads:[~2021-01-15  2:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14 19:02 [PATCH] mm/debug: Improve memcg debugging Matthew Wilcox (Oracle)
2021-01-15  2:19 ` Zi Yan [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=7E6A4334-D1D0-4FBC-93EE-185B7A87992D@nvidia.com \
    --to=ziy@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.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).