linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 01/12] mm/debug_vm_pgtable: Introduce struct pgtable_debug_args
Date: Fri, 23 Jul 2021 10:43:20 +1000	[thread overview]
Message-ID: <118678e4-b67a-2141-8caa-3bbb9e9cdc19@redhat.com> (raw)
In-Reply-To: <4a534102-11ff-c849-781e-ed173e46da56@arm.com>

Hi Anshuman,

On 7/22/21 5:08 PM, Anshuman Khandual wrote:
> On 7/22/21 11:53 AM, Gavin Shan wrote:
>> On 7/22/21 2:41 PM, Anshuman Khandual wrote:
>>> On 7/21/21 3:50 PM, Gavin Shan wrote:
>>>> On 7/21/21 3:44 PM, Anshuman Khandual wrote:
>>>>> On 7/19/21 6:36 PM, Gavin Shan wrote:
>>>>>> In debug_vm_pgtable(), there are many local variables introduced to
>>>>>> track the needed information and they are passed to the functions for
>>>>>> various test cases. It'd better to introduce a struct as place holder
>>>>>> for these information. With it, what the functions for various test
>>>>>> cases need is the struct, to simplify the code. It also makes code
>>>>>> easier to be maintained.
>>>>>>
>>>>>> Besides, set_xxx_at() could access the data on the corresponding pages
>>>>>> in the page table modifying tests. So the accessed pages in the tests
>>>>>> should have been allocated from buddy. Otherwise, we're accessing pages
>>>>>> that aren't owned by us. This causes issues like page flag corruption.
>>>>>>
>>>>>> This introduces "struct pgtable_debug_args". The struct is initialized
>>>>>> and destroyed, but the information in the struct isn't used yet. They
>>>>>> will be used in subsequent patches.
>>>>>>
>>>>>> Signed-off-by: Gavin Shan <gshan@redhat.com>
>>>>>> ---
>>>>>>     mm/debug_vm_pgtable.c | 197 +++++++++++++++++++++++++++++++++++++++++-
>>>>>>     1 file changed, 196 insertions(+), 1 deletion(-)
>>>>>>

[...]

>>>
>>> IIRC it is also not guaranteed that PMD_SHIFT <= (MAX_ORDER - 1). Hence
>>> this same scheme should be followed for PMD level allocation as well.
>>>
>>
>> In theory, it's possible to have PMD_SHIFT <= (MAX_ORDER - 1) with misconfigured
>> kernel. I will apply the similar logic to PMD huge page in v4.
>>
>>>>       [... The code to release the PUD huge page needs changes based on @args->is_contiguous_pud_page]
>>>
>>> Right, a flag would be needed to call the appropriate free function.
>>>
>>
>> Yes. We need two falgs for PUD and PMD huge pages separately.
> 
> A single flag should be enough, the order would be dependent on
> whether args->pud_pfn or args->pmd_pfn is valid.
> 

Yes, it's correct that one flag is enough as we're sharing the PUD
or PMD huge page.

Thanks,
Gavin


  reply	other threads:[~2021-07-23  0:44 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 [this message]
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

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=118678e4-b67a-2141-8caa-3bbb9e9cdc19@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).