From: Gavin Shan <gshan@redhat.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>, linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org, catalin.marinas@arm.com,
will@kernel.org, akpm@linux-foundation.org, chuhu@redhat.com,
shan.gavin@gmail.com
Subject: Re: [PATCH v3 12/12] mm/debug_vm_pgtable: Fix corrupted page flag
Date: Thu, 22 Jul 2021 16:54:29 +1000 [thread overview]
Message-ID: <5d9f2080-7020-d3f0-73cc-ae2af0943303@redhat.com> (raw)
In-Reply-To: <5db75fd6-aeb9-c06f-30ab-839c09a0bc68@arm.com>
Hi Anshuman,
On 7/22/21 1:51 PM, Anshuman Khandual wrote:
> Small nit:
>
> s/Fix corrupted page flag/Fix page flag corruption on arm64/
>
Sure, The replacement will be applied in v4, thanks!
> On 7/21/21 5:33 PM, Gavin Shan wrote:
>> Hi Anshuman,
>>
>> On 7/21/21 8:18 PM, Anshuman Khandual wrote:
>>> On 7/19/21 6:36 PM, Gavin Shan wrote:
>>>> In page table entry modifying tests, set_xxx_at() are used to populate
>>>> the page table entries. On ARM64, PG_arch_1 is set to the target page
>>>> flag if execution permission is given. The page flag is kept when the
>>>> page is free'd to buddy's free area list. However, it will trigger page
>>>> checking failure when it's pulled from the buddy's free area list, as
>>>> the following warning messages indicate.
>>>>
>>>> BUG: Bad page state in process memhog pfn:08000
>>>> page:0000000015c0a628 refcount:0 mapcount:0 \
>>>> mapping:0000000000000000 index:0x1 pfn:0x8000
>>>> flags: 0x7ffff8000000800(arch_1|node=0|zone=0|lastcpupid=0xfffff)
>>>> raw: 07ffff8000000800 dead000000000100 dead000000000122 0000000000000000
>>>> raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
>>>> page dumped because: PAGE_FLAGS_CHECK_AT_PREP flag(s) set
>>>>
>>>> This fixes the issue by clearing PG_arch_1 through flush_dcache_page()
>>>> after set_xxx_at() is called.
>>>
>>> Could you please add comments before each flush_dcache_page() instance
>>> explaining why this is needed for arm64 platforms with relevant PG_arch_1
>>> context and how this does not have any adverse effect on other platforms ?
>>> It should be easy for some one looking at this code after a while to figure
>>> out from where flush_dcache_page() came from.
>>>
>>
>> Good point. I will improve chage log to include the commit ID in v4 where the
>> page flag (PG_arch_1) is used and explain how. In that case, it's much clearer
>> to understand the reason why we need flush_dcache_page() after set_xxx_at() on
>> ARM64.
>
> But also some in code comments where flush_dcache_page() is being called.
>
Yes, I will add some comments where flush_dcache_page() is called in v4.
Thanks,
Gavin
prev parent reply other threads:[~2021-07-22 6:55 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-19 13:06 [PATCH v3 00/12] mm/debug_vm_pgtable: Enhancements Gavin Shan
2021-07-19 13:06 ` [PATCH v3 01/12] mm/debug_vm_pgtable: Introduce struct pgtable_debug_args Gavin Shan
2021-07-21 5:44 ` Anshuman Khandual
2021-07-21 10:20 ` Gavin Shan
2021-07-21 10:39 ` Anshuman Khandual
2021-07-21 10:59 ` Anshuman Khandual
2021-07-21 11:59 ` Gavin Shan
2021-07-22 4:41 ` Anshuman Khandual
2021-07-22 6:23 ` Gavin Shan
2021-07-22 7:08 ` Anshuman Khandual
2021-07-23 0:43 ` Gavin Shan
2021-07-19 13:06 ` [PATCH v3 02/12] mm/debug_vm_pgtable: Use struct pgtable_debug_args in basic tests Gavin Shan
2021-07-21 5:57 ` Anshuman Khandual
2021-07-21 11:57 ` Gavin Shan
2021-07-19 13:06 ` [PATCH v3 03/12] mm/debug_vm_pgtable: Use struct pgtable_debug_args in leaf and savewrite tests Gavin Shan
2021-07-19 13:06 ` [PATCH v3 04/12] mm/debug_vm_pgtable: Use struct pgtable_debug_args in protnone and devmap tests Gavin Shan
2021-07-19 13:06 ` [PATCH v3 05/12] mm/debug_vm_pgtable: Use struct pgtable_debug_args in soft_dirty and swap tests Gavin Shan
2021-07-19 13:06 ` [PATCH v3 06/12] mm/debug_vm_pgtable: Use struct pgtable_debug_args in migration and thp tests Gavin Shan
2021-07-19 13:06 ` [PATCH v3 07/12] mm/debug_vm_pgtable: Use struct pgtable_debug_args in PTE modifying tests Gavin Shan
2021-07-22 5:56 ` Anshuman Khandual
2021-07-22 6:37 ` Gavin Shan
2021-07-23 2:39 ` Anshuman Khandual
2021-07-23 4:23 ` Gavin Shan
2021-07-19 13:06 ` [PATCH v3 08/12] mm/debug_vm_pgtable: Use struct pgtable_debug_args in PMD " Gavin Shan
2021-07-22 5:45 ` Anshuman Khandual
2021-07-22 6:41 ` Gavin Shan
2021-07-22 7:11 ` Anshuman Khandual
2021-07-23 1:00 ` Gavin Shan
2021-07-23 2:33 ` Anshuman Khandual
2021-07-19 13:06 ` [PATCH v3 09/12] mm/debug_vm_pgtable: Use struct pgtable_debug_args in PUD " Gavin Shan
2021-07-22 5:39 ` Anshuman Khandual
2021-07-22 6:47 ` Gavin Shan
2021-07-19 13:06 ` [PATCH v3 10/12] mm/debug_vm_pgtable: Use struct pgtable_debug_args in PGD and P4D " Gavin Shan
2021-07-22 5:09 ` Anshuman Khandual
2021-07-22 6:50 ` Gavin Shan
2021-07-19 13:06 ` [PATCH v3 11/12] mm/debug_vm_pgtable: Remove unused code Gavin Shan
2021-07-22 4:51 ` Anshuman Khandual
2021-07-22 6:53 ` Gavin Shan
2021-07-19 13:06 ` [PATCH v3 12/12] mm/debug_vm_pgtable: Fix corrupted page flag Gavin Shan
2021-07-21 10:18 ` Anshuman Khandual
2021-07-21 12:03 ` Gavin Shan
2021-07-22 3:51 ` Anshuman Khandual
2021-07-22 6:54 ` Gavin Shan [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=5d9f2080-7020-d3f0-73cc-ae2af0943303@redhat.com \
--to=gshan@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=chuhu@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shan.gavin@gmail.com \
--cc=will@kernel.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).