* [RFC] mm: Do not look up the next level table when large page exist.
@ 2018-07-25 15:21 zhong jiang
2018-07-25 16:53 ` Catalin Marinas
0 siblings, 1 reply; 3+ messages in thread
From: zhong jiang @ 2018-07-25 15:21 UTC (permalink / raw)
To: linux-arm-kernel
show_pte can show the kernel page table and user page table. user
page table is totally four level table. but kernel page table can
be a large page. Therefore, it need to check the page table.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
arch/arm64/mm/fault.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 1b40676..a397a54 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -169,13 +169,13 @@ void show_pte(unsigned long addr)
pudp = pud_offset(pgdp, addr);
pud = READ_ONCE(*pudp);
pr_cont(", pud=%016llx", pud_val(pud));
- if (pud_none(pud) || pud_bad(pud))
+ if (pud_none(pud) || pud_bad(pud) || pud_sect(pud))
break;
pmdp = pmd_offset(pudp, addr);
pmd = READ_ONCE(*pmdp);
pr_cont(", pmd=%016llx", pmd_val(pmd));
- if (pmd_none(pmd) || pmd_bad(pmd))
+ if (pmd_none(pmd) || pmd_bad(pmd) || pmd_sect(pmd))
break;
ptep = pte_offset_map(pmdp, addr);
--
1.7.12.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [RFC] mm: Do not look up the next level table when large page exist.
2018-07-25 15:21 [RFC] mm: Do not look up the next level table when large page exist zhong jiang
@ 2018-07-25 16:53 ` Catalin Marinas
2018-07-26 1:51 ` zhong jiang
0 siblings, 1 reply; 3+ messages in thread
From: Catalin Marinas @ 2018-07-25 16:53 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jul 25, 2018 at 11:21:59PM +0800, zhong jiang wrote:
> show_pte can show the kernel page table and user page table. user
> page table is totally four level table.
Well, you can have huge pages in user space.
> but kernel page table can
> be a large page. Therefore, it need to check the page table.
>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
> arch/arm64/mm/fault.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
> index 1b40676..a397a54 100644
> --- a/arch/arm64/mm/fault.c
> +++ b/arch/arm64/mm/fault.c
> @@ -169,13 +169,13 @@ void show_pte(unsigned long addr)
> pudp = pud_offset(pgdp, addr);
> pud = READ_ONCE(*pudp);
> pr_cont(", pud=%016llx", pud_val(pud));
> - if (pud_none(pud) || pud_bad(pud))
> + if (pud_none(pud) || pud_bad(pud) || pud_sect(pud))
Have you actually hit a problem with this code?
pud_sect() checks that the bottom two bits of the pud are 0b01.
pud_bad() is true when bit 1 is 0, which is the case with a section
mapping.
--
Catalin
^ permalink raw reply [flat|nested] 3+ messages in thread
* [RFC] mm: Do not look up the next level table when large page exist.
2018-07-25 16:53 ` Catalin Marinas
@ 2018-07-26 1:51 ` zhong jiang
0 siblings, 0 replies; 3+ messages in thread
From: zhong jiang @ 2018-07-26 1:51 UTC (permalink / raw)
To: linux-arm-kernel
On 2018/7/26 0:53, Catalin Marinas wrote:
> On Wed, Jul 25, 2018 at 11:21:59PM +0800, zhong jiang wrote:
>> show_pte can show the kernel page table and user page table. user
>> page table is totally four level table.
> Well, you can have huge pages in user space.
No, I have not.
>> but kernel page table can
>> be a large page. Therefore, it need to check the page table.
>>
>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>> ---
>> arch/arm64/mm/fault.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
>> index 1b40676..a397a54 100644
>> --- a/arch/arm64/mm/fault.c
>> +++ b/arch/arm64/mm/fault.c
>> @@ -169,13 +169,13 @@ void show_pte(unsigned long addr)
>> pudp = pud_offset(pgdp, addr);
>> pud = READ_ONCE(*pudp);
>> pr_cont(", pud=%016llx", pud_val(pud));
>> - if (pud_none(pud) || pud_bad(pud))
>> + if (pud_none(pud) || pud_bad(pud) || pud_sect(pud))
> Have you actually hit a problem with this code?
Not yet. Maybe I use the function mistake. It is only used for user and vmalloc
pagefault. It should be not handled with large level table. thank you for time.
Thanks,
zhong jiang
> pud_sect() checks that the bottom two bits of the pud are 0b01.
> pud_bad() is true when bit 1 is 0, which is the case with a section
> mapping.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-26 1:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-25 15:21 [RFC] mm: Do not look up the next level table when large page exist zhong jiang
2018-07-25 16:53 ` Catalin Marinas
2018-07-26 1:51 ` zhong jiang
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).