Re: [PATCH 1/4] m68k: mm: Convert get_pointer_table() to use ptdescs
From: Geert Uytterhoeven
Date: Thu Jun 26 2025 - 04:41:00 EST
Hi Vishal,
On Wed, 11 Jun 2025 at 02:13, Vishal Moola (Oracle)
<vishal.moola@xxxxxxxxx> wrote:
> Motorola uses get_pointer_table() for page tables, so it should be using
> struct ptdesc, not struct page.
>
> This helps us prepare to allocate ptdescs as their own memory
> descriptor, and prepares to remove a user of page->lru.
>
> Signed-off-by: Vishal Moola (Oracle) <vishal.moola@xxxxxxxxx>
Thanks for your patch!
Reviewed-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
i.e. will queue in the m68k tree for v6.17, with the small changes
described below.
> --- a/arch/m68k/mm/motorola.c
> +++ b/arch/m68k/mm/motorola.c
> @@ -148,16 +148,18 @@ void *get_pointer_table(struct mm_struct *mm, int type)
>
> /*
> * For a pointer table for a user process address space, a
> - * table is taken from a page allocated for the purpose. Each
> - * page can hold 8 pointer tables. The page is remapped in
> + * table is taken from a ptdesc allocated for the purpose. Each
> + * ptdesc can hold 8 pointer tables. The ptdesc is remapped in
> * virtual address space to be noncacheable.
> */
> if (mask == 0) {
> - void *page;
> + struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL | __GFP_ZERO, 0);
I will move the assignment just before the NULL-check below, to ease
applying the WIP preempt patches on top.
> + void *pt_addr;
I will move this one line down, to follow the reverse Xmas rule.
> ptable_desc *new;
>
> - if (!(page = (void *)get_zeroed_page(GFP_KERNEL)))
> + if (!ptdesc)
> return NULL;
> + pt_addr = ptdesc_address(ptdesc);
>
> switch (type) {
> case TABLE_PTE:
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds