[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fe6caf5a-785c-48ea-ae33-dbce6be442e6@csgroup.eu>
Date: Wed, 29 May 2024 09:39:19 +0000
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Oscar Salvador <osalvador@...e.com>
CC: Andrew Morton <akpm@...ux-foundation.org>, Jason Gunthorpe
<jgg@...dia.com>, Peter Xu <peterx@...hat.com>, Michael Ellerman
<mpe@...erman.id.au>, Nicholas Piggin <npiggin@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>, "linuxppc-dev@...ts.ozlabs.org"
<linuxppc-dev@...ts.ozlabs.org>
Subject: Re: [RFC PATCH v4 08/16] powerpc/8xx: Rework support for 8M pages
using contiguous PTE entries
Le 29/05/2024 à 10:02, Oscar Salvador a écrit :
> [Vous ne recevez pas souvent de courriers de osalvador@...e.com. D?couvrez pourquoi ceci est important ? https://aka.ms/LearnAboutSenderIdentification ]
>
> On Mon, May 27, 2024 at 03:30:06PM +0200, Christophe Leroy wrote:
>> In order to fit better with standard Linux page tables layout, add
>> support for 8M pages using contiguous PTE entries in a standard
>> page table. Page tables will then be populated with 1024 similar
>> entries and two PMD entries will point to that page table.
>>
>> The PMD entries also get a flag to tell it is addressing an 8M page,
>> this is required for the HW tablewalk assistance.
>>
>> Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>
>> Reviewed-by: Oscar Salvador <osalvador@...e.de>
>> ---
> ...
>> +#define __HAVE_ARCH_HUGE_PTEP_GET
>> +static inline pte_t huge_ptep_get(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
>> +{
>> + if (ptep_is_8m_pmdp(mm, addr, ptep))
>> + ptep = pte_offset_kernel((pmd_t *)ptep, 0);
>
> Yes, you are right that this should have had the addr aligned down.
>
> I can speak for others, but for me it is more clear to think of it this way:
>
> 1) check if ptep points to the first PMD entry for address
> 2) if it does, we know that the PMD describes a 8MB hugepage
> 3) return the PMD
But it is not exactly the way I see it, maybe I'm wrong but from my
point of view:
1) check if ptep points to the first PMD entry for address
2) if it does, we know that the PMD relates to a 8MB hugepage
3) Return the first PTE in the page table pointed by the said PMD entry.
>
> That is why I thought that directly calling pmd_page_vaddr() gave a more clear
> overview.
>
> Now, feel free to ignore this if you think this is not clear or adds confusion,
> I just wanted to give my insight reflecting on what I considered more
> logical.
For me using pte_offset_kernel() make it more clear that we want a PTE
in a page table, and not some raw information at a given address pointed
to by a huge-PMD.
Am I wrong ?
>
>
> --
> Oscar Salvador
> SUSE Labs
Powered by blists - more mailing lists