diff options
author | Peter Zijlstra <peterz@infradead.org> | 2020-01-31 13:45:39 +0100 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2020-02-10 10:57:48 +0100 |
commit | 0e071ee6815692a3b241bbe9a9a29f7cdec023ed (patch) | |
tree | fa516f2a287d2f5315a98ebeeb472d46dc6f9ddc /arch/m68k/mm/init.c | |
parent | 61c64a25ae8df45c2cd2f76343e20c3d266382ea (diff) | |
download | linux-0e071ee6815692a3b241bbe9a9a29f7cdec023ed.tar.bz2 |
m68k: mm: Extend table allocator for multiple sizes
In addition to the PGD/PMD table size (128*4) add a PTE table size
(64*4) to the table allocator. This completely removes the pte-table
overhead compared to the old code, even for dense tables.
Notes:
- the allocator gained a list_empty() check to deal with there not
being any pages at all.
- the free mask is extended to cover more than the 8 bits required
for the (512 byte) PGD/PMD tables.
- NR_PAGETABLE accounting is restored.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Greg Ungerer <gerg@linux-m68k.org>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Tested-by: Greg Ungerer <gerg@linux-m68k.org>
Link: https://lore.kernel.org/r/20200131125403.882175409@infradead.org
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k/mm/init.c')
-rw-r--r-- | arch/m68k/mm/init.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c index a9b6d26cff8a..3e3a74a5b215 100644 --- a/arch/m68k/mm/init.c +++ b/arch/m68k/mm/init.c @@ -40,10 +40,6 @@ void *empty_zero_page; EXPORT_SYMBOL(empty_zero_page); -#if !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE) -extern void init_pointer_table(unsigned long ptable); -#endif - #ifdef CONFIG_MMU pg_data_t pg_data_map[MAX_NUMNODES]; @@ -127,12 +123,16 @@ static inline void init_pointer_tables(void) int i; /* insert pointer tables allocated so far into the tablelist */ - init_pointer_table((unsigned long)kernel_pg_dir); + init_pointer_table(kernel_pg_dir, TABLE_PGD); for (i = 0; i < PTRS_PER_PGD; i++) { - pud_t *pud = (pud_t *)(&kernel_pg_dir[i]); + pud_t *pud = (pud_t *)&kernel_pg_dir[i]; + pmd_t *pmd_dir; + + if (!pud_present(*pud)) + continue; - if (pud_present(*pud)) - init_pointer_table(pgd_page_vaddr(kernel_pg_dir[i])); + pmd_dir = (pmd_t *)pgd_page_vaddr(kernel_pg_dir[i]); + init_pointer_table(pmd_dir, TABLE_PMD); } #endif } |