From: John Hubbard <jhubbard@nvidia.com>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>, <linux-mm@kvack.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Vlastimil Babka <vbabka@suse.cz>,
"Kirill A. Shutemov" <kirill@shutemov.name>,
William Kucharski <william.kucharski@oracle.com>,
Mike Rapoport <rppt@linux.ibm.com>
Subject: Re: [PATCH v2 1/6] mm: Handle page->mapping better in dump_page
Date: Fri, 10 Jul 2020 18:32:50 -0700 [thread overview]
Message-ID: <e8206300-0b73-384b-c8c6-2eb255d0abe7@nvidia.com> (raw)
In-Reply-To: <15cff11a-6762-8a6a-3f0e-dd227280cd6f@nvidia.com>
On 2020-07-10 18:30, John Hubbard wrote:
> On 2020-07-09 13:21, Matthew Wilcox (Oracle) wrote:
>> If we can't call page_mapping() to get the page mapping, handle the
>> anon/ksm/movable bits correctly.
>
> Hi Matthew,
>
> I see why you did this, as otherwise the new printing won't work.
Oh, and I forget to add: my only comment was just a documentation
suggestion, not critical at all, and so:
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
thanks,
--
John Hubbard
NVIDIA
>
>>
>> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
>> ---
>> mm/debug.c | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/mm/debug.c b/mm/debug.c
>> index 4f376514744d..e5de63406b59 100644
>> --- a/mm/debug.c
>> +++ b/mm/debug.c
>> @@ -70,7 +70,12 @@ void __dump_page(struct page *page, const char *reason)
>> if (page < head || (page >= head + MAX_ORDER_NR_PAGES)) {
>> /* Corrupt page, cannot call page_mapping */
>
> It's tricky to step lightly through the debris of corrupted page
> pointer here, but how about this updated comment, to replace the one-liner
> above:
>
> /*
> * Corrupt page, so we cannot call page_mapping. Instead, do a
> * safe subset of the steps that page_mapping() does. Caution:
> * this will be misleading for tail pages, PageSwapCache pages,
> * and potentially other situations. (See the page_mapping()
> * implementation for what's missing here.)
> */
>
>
>> - mapping = page->mapping;
>> + unsigned long tmp = (unsigned long)page->mapping;
>> +
>> + if (tmp & PAGE_MAPPING_ANON)
>> + mapping = NULL;
>> + else
>> + mapping = (void *)(tmp & ~PAGE_MAPPING_FLAGS);
>> head = page;
>> compound = false;
>> } else {
>>
>
next prev parent reply other threads:[~2020-07-11 1:32 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-09 20:21 [PATCH v2 0/6] Improvements for dump_page() Matthew Wilcox (Oracle)
2020-07-09 20:21 ` [PATCH v2 1/6] mm: Handle page->mapping better in dump_page Matthew Wilcox (Oracle)
2020-07-11 1:30 ` John Hubbard
2020-07-11 1:32 ` John Hubbard [this message]
2020-07-14 11:06 ` Vlastimil Babka
2020-07-09 20:21 ` [PATCH v2 2/6] mm: Dump compound page information on a second line Matthew Wilcox (Oracle)
2020-07-11 1:35 ` John Hubbard
2020-07-14 12:03 ` Vlastimil Babka
2020-08-04 15:37 ` Qian Cai
2020-08-04 16:14 ` Matthew Wilcox
2020-08-04 18:39 ` [PATCH] mm, dump_page: do not crash with bad compound_page() John Hubbard
2020-08-04 18:48 ` Matthew Wilcox
2020-08-04 19:17 ` John Hubbard
2020-08-04 19:42 ` Matthew Wilcox
2020-07-09 20:21 ` [PATCH v2 3/6] mm: Print head flags in dump_page Matthew Wilcox (Oracle)
2020-07-11 1:40 ` John Hubbard
2020-07-14 12:06 ` Vlastimil Babka
2020-07-09 20:21 ` [PATCH v2 4/6] mm: Switch dump_page to get_kernel_nofault Matthew Wilcox (Oracle)
2020-07-14 12:11 ` Vlastimil Babka
2020-07-09 20:21 ` [PATCH v2 5/6] mm: Print the inode number in dump_page Matthew Wilcox (Oracle)
2020-07-11 2:04 ` John Hubbard
2020-07-14 12:18 ` Vlastimil Babka
2020-07-09 20:21 ` [PATCH v2 6/6] mm: Print hashed address of struct page Matthew Wilcox (Oracle)
2020-07-11 1:48 ` John Hubbard
2020-07-09 20:54 ` [PATCH v2 0/6] Improvements for dump_page() Mike Rapoport
2020-07-09 20:54 ` William Kucharski
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=e8206300-0b73-384b-c8c6-2eb255d0abe7@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=kirill@shutemov.name \
--cc=linux-mm@kvack.org \
--cc=rppt@linux.ibm.com \
--cc=vbabka@suse.cz \
--cc=william.kucharski@oracle.com \
--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