Commit 4fe9ef52 authored by David S. Miller's avatar David S. Miller Committed by Greg Kroah-Hartman

sparc64: Kill unnecessary tables and increase MAX_BANKS.

[ Upstream commit d195b71b ]

swapper_low_pmd_dir and swapper_pud_dir are actually completely
useless and unnecessary.

We just need swapper_pg_dir[].  Naturally the other page table chunks
will be allocated on an as-needed basis.  Since the kernel actually
accesses these tables in the PAGE_OFFSET view, there is not even a TLB
locality advantage of placing them in the kernel image.

Use the hard coded vmlinux.ld.S slot for swapper_pg_dir which is
naturally page aligned.

Increase MAX_BANKS to 1024 in order to handle heavily fragmented
virtual guests.

Even with this MAX_BANKS increase, the kernel is 20K+ smaller.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Acked-by: default avatarBob Picco <bob.picco@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6720e85b
...@@ -927,7 +927,6 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr, ...@@ -927,7 +927,6 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
#endif #endif
extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
extern pmd_t swapper_low_pmd_dir[PTRS_PER_PMD];
void paging_init(void); void paging_init(void);
unsigned long find_ecache_flush_span(unsigned long size); unsigned long find_ecache_flush_span(unsigned long size);
......
...@@ -35,8 +35,9 @@ jiffies = jiffies_64; ...@@ -35,8 +35,9 @@ jiffies = jiffies_64;
SECTIONS SECTIONS
{ {
/* swapper_low_pmd_dir is sparc64 only */ #ifdef CONFIG_SPARC64
swapper_low_pmd_dir = 0x0000000000402000; swapper_pg_dir = 0x0000000000402000;
#endif
. = INITIAL_ADDRESS; . = INITIAL_ADDRESS;
.text TEXTSTART : .text TEXTSTART :
{ {
......
...@@ -86,7 +86,7 @@ extern struct tsb swapper_tsb[KERNEL_TSB_NENTRIES]; ...@@ -86,7 +86,7 @@ extern struct tsb swapper_tsb[KERNEL_TSB_NENTRIES];
static unsigned long cpu_pgsz_mask; static unsigned long cpu_pgsz_mask;
#define MAX_BANKS 32 #define MAX_BANKS 1024
static struct linux_prom64_registers pavail[MAX_BANKS]; static struct linux_prom64_registers pavail[MAX_BANKS];
static int pavail_ents; static int pavail_ents;
...@@ -1942,12 +1942,6 @@ static void __init sun4v_linear_pte_xor_finalize(void) ...@@ -1942,12 +1942,6 @@ static void __init sun4v_linear_pte_xor_finalize(void)
static unsigned long last_valid_pfn; static unsigned long last_valid_pfn;
/* These must be page aligned in order to not trigger the
* alignment tests of pgd_bad() and pud_bad().
*/
pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((aligned (PAGE_SIZE)));
static pud_t swapper_pud_dir[PTRS_PER_PUD] __attribute__ ((aligned (PAGE_SIZE)));
static void sun4u_pgprot_init(void); static void sun4u_pgprot_init(void);
static void sun4v_pgprot_init(void); static void sun4v_pgprot_init(void);
...@@ -1955,8 +1949,6 @@ void __init paging_init(void) ...@@ -1955,8 +1949,6 @@ void __init paging_init(void)
{ {
unsigned long end_pfn, shift, phys_base; unsigned long end_pfn, shift, phys_base;
unsigned long real_end, i; unsigned long real_end, i;
pud_t *pud;
pmd_t *pmd;
int node; int node;
setup_page_offset(); setup_page_offset();
...@@ -2051,20 +2043,7 @@ void __init paging_init(void) ...@@ -2051,20 +2043,7 @@ void __init paging_init(void)
*/ */
init_mm.pgd += ((shift) / (sizeof(pgd_t))); init_mm.pgd += ((shift) / (sizeof(pgd_t)));
memset(swapper_low_pmd_dir, 0, sizeof(swapper_low_pmd_dir)); memset(swapper_pg_dir, 0, sizeof(swapper_pg_dir));
/* The kernel page tables we publish into what the rest of the
* world sees must be adjusted so that they see the PAGE_OFFSET
* address of these in-kerenel data structures. However right
* here we must access them from the kernel image side, because
* the trap tables haven't been taken over and therefore we cannot
* take TLB misses in the PAGE_OFFSET linear mappings yet.
*/
pud = swapper_pud_dir + (shift / sizeof(pud_t));
pgd_set(&swapper_pg_dir[0], pud);
pmd = swapper_low_pmd_dir + (shift / sizeof(pmd_t));
pud_set(&swapper_pud_dir[0], pmd);
inherit_prom_mappings(); inherit_prom_mappings();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment