[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200131102239.GB14914@hirez.programming.kicks-ass.net>
Date: Fri, 31 Jan 2020 11:22:39 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Will Deacon <will@...nel.org>
Cc: Greg Ungerer <gerg@...ux-m68k.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
linux-m68k@...ts.linux-m68k.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 0/5] Rewrite Motorola MMU page-table layout
On Fri, Jan 31, 2020 at 09:38:13AM +0000, Will Deacon wrote:
> > This series breaks compilation for the ColdFire (with MMU) variant of
> > the m68k family:
That's like the same I had reported by the build robots for sun3, which
I fixed by frobbing pgtable_t. That said, this is probably a more
consistent change.
One note below:
> -static inline struct page *pte_alloc_one(struct mm_struct *mm)
> +static inline pgtable_t pte_alloc_one(struct mm_struct *mm)
> {
> struct page *page = alloc_pages(GFP_DMA, 0);
> pte_t *pte;
> @@ -54,20 +55,19 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm)
> return NULL;
> }
>
> - pte = kmap(page);
> - if (pte) {
> - clear_page(pte);
> - __flush_page_to_ram(pte);
> - flush_tlb_kernel_page(pte);
> - nocache_page(pte);
> - }
> - kunmap(page);
> + pte = page_address(page);
> + clear_page(pte);
> + __flush_page_to_ram(pte);
> + flush_tlb_kernel_page(pte);
> + nocache_page(pte);
See how it does the nocache dance ^
>
> - return page;
> + return pte;
> }
>
> -static inline void pte_free(struct mm_struct *mm, struct page *page)
> +static inline void pte_free(struct mm_struct *mm, pgtable_t pgtable)
> {
> + struct page *page = virt_to_page(pgtable);
> +
but never sets it cached again!
> pgtable_pte_page_dtor(page);
> __free_page(page);
> }
Also, the alloc_one_kernel() also suspicioudly doesn't do the nocache
thing.
So either, alloc_one() shouldn't either, or it's all buggered.
Powered by blists - more mailing lists