From: Will Deacon <will@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] m68k,mm: Use table allocator for pgtables
Date: Wed, 29 Jan 2020 12:11:50 +0000 [thread overview]
Message-ID: <20200129121149.GA31582@willie-the-truck> (raw)
In-Reply-To: <20200129104345.434705552@infradead.org>
On Wed, Jan 29, 2020 at 11:39:44AM +0100, Peter Zijlstra wrote:
> With the new page-table layout, using full (4k) pages for (256 byte)
> pte-tables is immensely wastefull. Move the pte-tables over to the
> same allocator already used for the (512 byte) higher level tables
> (pgd/pmd).
>
> This reduces the pte-table waste from 15x to 2x.
>
> Due to no longer being bound to 16 consecutive tables, this might
> actually already be more efficient than the old code for sparse
> tables.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
> arch/m68k/include/asm/motorola_pgalloc.h | 54 ++++++-------------------------
> arch/m68k/include/asm/motorola_pgtable.h | 8 ++++
> arch/m68k/include/asm/page.h | 2 -
> 3 files changed, 19 insertions(+), 45 deletions(-)
>
> --- a/arch/m68k/include/asm/motorola_pgalloc.h
> +++ b/arch/m68k/include/asm/motorola_pgalloc.h
> @@ -10,60 +10,28 @@ extern int free_pointer_table(pmd_t *);
>
> static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
> {
> - pte_t *pte;
> -
> - pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
> - if (pte) {
> - __flush_page_to_ram(pte);
> - flush_tlb_kernel_page(pte);
> - nocache_page(pte);
> - }
> -
> - return pte;
> + return (pte_t *)get_pointer_table();
Weirdly, get_pointer_table() seems to elide the __flush_page_to_ram()
call, so you're missing that for ptes with this change. I think it's
probably needed for the higher levels too (and kernel_page_table()
does it for example) so I'd be inclined to add it unconditionally
rather than predicate it on the allocation type introduced by your later
patch.
> --- a/arch/m68k/include/asm/page.h
> +++ b/arch/m68k/include/asm/page.h
> @@ -30,7 +30,7 @@ typedef struct { unsigned long pmd; } pm
> typedef struct { unsigned long pte; } pte_t;
> typedef struct { unsigned long pgd; } pgd_t;
> typedef struct { unsigned long pgprot; } pgprot_t;
> -typedef struct page *pgtable_t;
> +typedef pte_t *pgtable_t;
Urgh, this is a big (cross-arch) mess that we should fix later.
Will
next prev parent reply other threads:[~2020-01-29 12:12 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-29 10:39 [PATCH 0/5] Rewrite Motorola MMU page-table layout Peter Zijlstra
2020-01-29 10:39 ` [PATCH 1/5] m68k,mm: Restructure motorola mmu " Peter Zijlstra
2020-01-29 10:39 ` [PATCH 2/5] m68k,mm: Improve kernel_page_table() Peter Zijlstra
2020-01-29 10:39 ` [PATCH 3/5] m68k,mm: Use table allocator for pgtables Peter Zijlstra
2020-01-29 12:11 ` Will Deacon [this message]
2020-01-29 12:24 ` Peter Zijlstra
2020-01-29 10:39 ` [PATCH 4/5] m68k,mm: Extend table allocator for multiple sizes Peter Zijlstra
2020-01-29 12:17 ` Will Deacon
2020-01-29 12:43 ` Peter Zijlstra
2020-01-29 13:15 ` Will Deacon
2020-01-29 10:39 ` [PATCH 5/5] m68k,mm: Fully initialize the page-table allocator Peter Zijlstra
2020-01-29 10:49 ` [PATCH 0/5] Rewrite Motorola MMU page-table layout John Paul Adrian Glaubitz
2020-01-29 11:54 ` Peter Zijlstra
2020-01-29 12:05 ` John Paul Adrian Glaubitz
2020-01-29 12:30 ` Peter Zijlstra
2020-01-29 18:52 ` Michael Schmitz
2020-01-29 19:31 ` Peter Zijlstra
2020-01-30 7:31 ` Michael Schmitz
2020-01-30 8:16 ` Peter Zijlstra
2020-01-30 19:12 ` Michael Schmitz
2020-01-31 6:31 ` Greg Ungerer
2020-01-31 9:38 ` Will Deacon
2020-01-31 10:22 ` Peter Zijlstra
2020-01-31 11:14 ` Peter Zijlstra
2020-01-31 11:18 ` Will Deacon
2020-01-31 11:31 ` Peter Zijlstra
2020-01-31 11:43 ` Will Deacon
2020-01-31 13:04 ` Greg Ungerer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200129121149.GA31582@willie-the-truck \
--to=will@kernel.org \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).