rs and should not be used for page table pages.
>
> Signed-off-by: Qi Zheng
> Suggested-by: Peter Zijlstra (Intel)
Reviewed-by: Kevin Brodsky
le pages.
>
> Signed-off-by: Qi Zheng
> Suggested-by: Peter Zijlstra (Intel)
Reviewed-by: Kevin Brodsky
able() use struct ptdesc by default when
> CONFIG_MMU_GATHER_TABLE_FREE is disabled.
>
> Signed-off-by: Qi Zheng
Reviewed-by: Kevin Brodsky
a (Intel)
Reviewed-by: Kevin Brodsky
ree page table pages.
>
> Signed-off-by: Qi Zheng
Definitely a good idea to have split patch 11 from v4.
Reviewed-by: Kevin Brodsky
- Kevin
On 07/01/2025 13:31, Qi Zheng wrote:
> On 2025/1/7 19:58, Kevin Brodsky wrote:
>> On 07/01/2025 11:51, Qi Zheng wrote:
>>> [...]
>>>
>>> Author: Qi Zheng
>>> Date: Fri Dec 13 17:13:48 2024 +0800
>>>
>>> mm: pgtable: c
On 07/01/2025 11:51, Qi Zheng wrote:
> [...]
>
> Author: Qi Zheng
> Date: Fri Dec 13 17:13:48 2024 +0800
>
> mm: pgtable: completely move pagetable_dtor() to generic
> tlb_remove_table()
>
> For the generic tlb_remove_table(), it is implemented in the
> following two
> forms:
>
>
On 06/01/2025 04:49, Qi Zheng wrote:
> [...]
>
>> Once this is done, we should be able to replace all those confusing
>> calls to tlb_remove_page() on PTPs with tlb_remove_table() and remove
>> the explicit call to pagetable_dtor(). AIUI this is essentially what
>> Peter suggested on v3 [2].
>
> Si
On 06/01/2025 14:23, Qi Zheng wrote:
> On 2025/1/6 20:36, Alexander Gordeev wrote:
>> On Mon, Jan 06, 2025 at 06:55:58PM +0800, Qi Zheng wrote:
> +static inline void pagetable_dtor(struct ptdesc *ptdesc)
> +{
> + struct folio *folio = ptdesc_folio(ptdesc);
> +
> + ptlock_f
On 06/01/2025 09:38, Qi Zheng wrote:
> For this series:
>
> Acked-by: Qi Zheng
Thank you for the review, appreciated!
- Kevin
ansen
Signed-off-by: Kevin Brodsky
---
arch/arm/mm/pgd.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/arm/mm/pgd.c b/arch/arm/mm/pgd.c
index f8e9bc58a84f..2a1077747758 100644
--- a/arch/arm/mm/pgd.c
+++ b/arch/arm/mm/pgd.c
@@ -17,11 +17,11 @@
#include
page table pages.
This patch should cover all architectures and all configurations
where PGDs are one or more regular pages. This excludes any
configuration where PGDs are allocated from a kmem_cache object.
Acked-by: Dave Hansen
Signed-off-by: Kevin Brodsky
---
arch/m68k/include/asm/mcf_pgalloc.
s by
using GFP_PGTABLE_{USER,KERNEL} as appropriate.
Not all PGD allocations can be handled by the generic helpers. In
particular, multiple architectures allocate PGDs from a kmem_cache,
and those PGDs may not be page-sized.
Acked-by: Dave Hansen
Signed-off-by: Kevin Brodsky
---
arch/alpha
ating ptable_list for PMD/PGD levels.
Acked-by: Dave Hansen
Signed-off-by: Kevin Brodsky
---
arch/m68k/include/asm/motorola_pgalloc.h | 6 +++---
arch/m68k/mm/motorola.c | 17 -
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/arch/m68k/includ
) can handle higher allocation
orders so we don't need to define our own.
These changes ensure that pagetable_pmd_[cd]tor are called,
improving the accounting of page table pages.
Acked-by: Dave Hansen
Signed-off-by: Kevin Brodsky
---
arch/parisc/include/asm/pgalloc.h | 23
pagetable_*_ctor all have the same basic implementation. Move the
common part to a helper to reduce duplication.
Acked-by: Dave Hansen
Signed-off-by: Kevin Brodsky
---
include/linux/mm.h | 28
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/include
nps-...@lists.infradead.org
Cc: linux-um@lists.infradead.org
Cc: loonga...@lists.linux.dev
Cc: x...@kernel.org
---
Kevin Brodsky (6):
mm: Move common part of pagetable_*_ctor to helper
parisc: mm: Ensure pagetable_pmd_[cd]tor are called
m68k: mm: Add calls to pagetable_pmd_[cd]tor
ARM: mm: Rename PGD
On 03/01/2025 10:35, Qi Zheng wrote:
> On 2025/1/3 17:13, Qi Zheng wrote:
>> On 2025/1/3 16:02, Kevin Brodsky wrote:
>>> On 03/01/2025 04:48, Qi Zheng wrote:
>>>> [...]
>>>>
>>>> In __tlb_batch_free_encoded_pages(), we can indeed detect PageT
+Qi
On 03/01/2025 11:31, Alexandre Ghiti wrote:
> Hi Kevin,
>
> On 19/12/2024 17:44, Kevin Brodsky wrote:
>> {pmd,pud,p4d}_alloc_one() is never called if the corresponding page
>> table level is folded, as {pmd,pud,p4d}_alloc() already does the
>> required check.
On 20/12/2024 20:31, Dave Hansen wrote:
> On 12/20/24 02:58, Kevin Brodsky wrote:
>>> One super tiny nit is that the PAE pgd _can_ be allocated using
>>> __get_free_pages(). It was originally there for Xen, but I think it's
>>> being used for PTI only at this p
On 03/01/2025 04:48, Qi Zheng wrote:
> Hi Kevin,
>
> On 2025/1/3 00:53, Kevin Brodsky wrote:
>> On 30/12/2024 10:07, Qi Zheng wrote:
>>> static inline void riscv_tlb_remove_ptdesc(struct mmu_gather *tlb,
>>> void *pt)
>>> {
>>&g
On 03/01/2025 04:53, Qi Zheng wrote:
> On 2025/1/3 00:53, Kevin Brodsky wrote:
>> On 30/12/2024 10:07, Qi Zheng wrote:
>>> diff --git a/arch/riscv/include/asm/pgalloc.h
>>> b/arch/riscv/include/asm/pgalloc.h
>>> index 551d614d3369c..3466fbe2e508d 100644
>&g
ic pagetable_dtor_free()
Aside from the nit on patch 4 and the request for clarification on patch
10, this is looking good to me, so for the whole series (aside from my
own patches of course):
Reviewed-by: Kevin Brodsky
And happy new year!
Cheers,
- Kevin
On 30/12/2024 10:07, Qi Zheng wrote:
> static inline void riscv_tlb_remove_ptdesc(struct mmu_gather *tlb, void *pt)
> {
> - if (riscv_use_sbi_for_rfence())
> + if (riscv_use_sbi_for_rfence()) {
> tlb_remove_ptdesc(tlb, pt);
> - else
> + } else {
> + paget
On 30/12/2024 10:07, Qi Zheng wrote:
> diff --git a/arch/riscv/include/asm/pgalloc.h
> b/arch/riscv/include/asm/pgalloc.h
> index 551d614d3369c..3466fbe2e508d 100644
> --- a/arch/riscv/include/asm/pgalloc.h
> +++ b/arch/riscv/include/asm/pgalloc.h
> @@ -108,8 +108,12 @@ static inline void __pud_fr
On 20/12/2024 15:16, Qi Zheng wrote:
>>>
>>> Did I miss something?
>>>
>>> My patch series is not only for cleanup, but also for fixes of
>>> UAF issue [1], so is it possible to rebase your patch series onto
>>> mine? I can post v3 ASAP.
>>
>> I see, yours should be merged first then. The issue is
On 20/12/2024 12:46, Qi Zheng wrote:
> Hi Kevin,
>
> On 2024/12/20 18:49, Kevin Brodsky wrote:
>> [...]
>>
>> Qi, shall we collaborate to make our series complementary? I believe my
>> series covers patch 2 and 4 of your series, but it goes further by
>> co
On 19/12/2024 18:13, Dave Hansen wrote:
> On 12/19/24 08:44, Kevin Brodsky wrote:
>>
>> +---+-+---+--++
>> | x86 | Y | Y
Hi Peter, Qi,
On 19/12/2024 18:19, Peter Zijlstra wrote:
> On Thu, Dec 19, 2024 at 04:44:16PM +0000, Kevin Brodsky wrote:
>> Besides the ptlock management at PTE/PMD level, all the
>> pagetable_*_[cd]tor have the same implementation. Introduce common
>> helpers for all
page table pages.
This patch should cover all architectures and all configurations
where PGDs are one or more regular pages. This excludes any
configuration where PGDs are allocated from a kmem_cache object.
Signed-off-by: Kevin Brodsky
---
arch/m68k/include/asm/mcf_pgalloc.h | 2 ++
arch/m6
) can handle higher allocation
orders so we don't need to define our own.
These changes ensure that pagetable_pmd_[cd]tor are called,
improving the accounting of page table pages.
Signed-off-by: Kevin Brodsky
---
arch/parisc/include/asm/pgalloc.h | 23 ---
1 file c
o the ctor/dtor helpers in pud_alloc_one/pud_free
to match the other architectures.
Signed-off-by: Kevin Brodsky
---
arch/s390/include/asm/pgalloc.h | 13 +
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/arch/s390/include/asm/pgalloc.h b/arch/s390/include/asm/pgalloc.h
ind
PGD pages by
using GFP_PGTABLE_{USER,KERNEL} as appropriate.
Not all PGD allocations can be handled by the generic helpers. In
particular, multiple architectures allocate PGDs from a kmem_cache,
and those PGDs may not be page-sized.
Signed-off-by: Kevin Brodsky
---
arch/alpha
Generic implementations of __pgd_alloc and __pgd_free are about to
be introduced. Rename the macros in arch/arm/mm/pgd.c to avoid
clashes. While we're at it, also pass down the mm as argument to
those helpers, as it will be needed to call the generic
__pgd_{alloc,free}.
Signed-off-by:
alloc/free paths.
Besides the small improvement in accounting accuracy, this also
enables adding construction/destruction hooks in just one generic
place for page tables at P4D level (like lower levels).
Signed-off-by: Kevin Brodsky
---
arch/riscv/include/asm/pgalloc.h | 8 ++--
arch/s390/i
ht as well include this check
in the generic implementation. No runtime check is required in
p4d_alloc_one() as the top-level p4d_alloc() already does the
required check.
Signed-off-by: Kevin Brodsky
---
arch/arm64/include/asm/pgalloc.h | 17
arch/riscv/include/asm/pgalloc.h
remove it altogether.
This is consistent with the way arm64 and x86 handle this situation
(runtime check in p4d_free() only).
Signed-off-by: Kevin Brodsky
---
arch/riscv/include/asm/pgalloc.h | 22 --
1 file changed, 4 insertions(+), 18 deletions(-)
diff --git a/arch/riscv
ating ptable_list for PMD/PGD levels.
Signed-off-by: Kevin Brodsky
---
arch/m68k/include/asm/motorola_pgalloc.h | 6 +++---
arch/m68k/mm/motorola.c | 25 +++-
2 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/arch/m68k/include/asm/motorola_pgal
Besides the ptlock management at PTE/PMD level, all the
pagetable_*_[cd]tor have the same implementation. Introduce common
helpers for all levels to reduce the duplication.
Signed-off-by: Kevin Brodsky
---
include/linux/mm.h | 46 ++
1 file changed
nel.org
Cc: linux-ri...@lists.infradead.org
Cc: linux-s...@vger.kernel.org
Cc: linux-snps-...@lists.infradead.org
Cc: linux-um@lists.infradead.org
Cc: loonga...@lists.linux.dev
Cc: x...@kernel.org
---
Kevin Brodsky (10):
mm: Move common parts of pagetable_*_[cd]tor to helpers
parisc:
40 matches
Mail list logo