Skip to content

Commit d195b71

Browse files
committed
sparc64: Kill unnecessary tables and increase MAX_BANKS.
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: David S. Miller <[email protected]> Acked-by: Bob Picco <[email protected]>
1 parent ee6a933 commit d195b71

File tree

3 files changed

+5
-26
lines changed

3 files changed

+5
-26
lines changed

arch/sparc/include/asm/pgtable_64.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,6 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
927927
#endif
928928

929929
extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
930-
extern pmd_t swapper_low_pmd_dir[PTRS_PER_PMD];
931930

932931
void paging_init(void);
933932
unsigned long find_ecache_flush_span(unsigned long size);

arch/sparc/kernel/vmlinux.lds.S

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ jiffies = jiffies_64;
3535

3636
SECTIONS
3737
{
38-
/* swapper_low_pmd_dir is sparc64 only */
39-
swapper_low_pmd_dir = 0x0000000000402000;
38+
#ifdef CONFIG_SPARC64
39+
swapper_pg_dir = 0x0000000000402000;
40+
#endif
4041
. = INITIAL_ADDRESS;
4142
.text TEXTSTART :
4243
{

arch/sparc/mm/init_64.c

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ extern struct tsb swapper_tsb[KERNEL_TSB_NENTRIES];
8787

8888
static unsigned long cpu_pgsz_mask;
8989

90-
#define MAX_BANKS 32
90+
#define MAX_BANKS 1024
9191

9292
static struct linux_prom64_registers pavail[MAX_BANKS];
9393
static int pavail_ents;
@@ -1943,12 +1943,6 @@ static void __init sun4v_linear_pte_xor_finalize(void)
19431943

19441944
static unsigned long last_valid_pfn;
19451945

1946-
/* These must be page aligned in order to not trigger the
1947-
* alignment tests of pgd_bad() and pud_bad().
1948-
*/
1949-
pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((aligned (PAGE_SIZE)));
1950-
static pud_t swapper_pud_dir[PTRS_PER_PUD] __attribute__ ((aligned (PAGE_SIZE)));
1951-
19521946
static void sun4u_pgprot_init(void);
19531947
static void sun4v_pgprot_init(void);
19541948

@@ -2002,8 +1996,6 @@ void __init paging_init(void)
20021996
{
20031997
unsigned long end_pfn, shift, phys_base;
20041998
unsigned long real_end, i;
2005-
pud_t *pud;
2006-
pmd_t *pmd;
20071999
int node;
20082000

20092001
setup_page_offset();
@@ -2099,20 +2091,7 @@ void __init paging_init(void)
20992091
*/
21002092
init_mm.pgd += ((shift) / (sizeof(pgd_t)));
21012093

2102-
memset(swapper_low_pmd_dir, 0, sizeof(swapper_low_pmd_dir));
2103-
2104-
/* The kernel page tables we publish into what the rest of the
2105-
* world sees must be adjusted so that they see the PAGE_OFFSET
2106-
* address of these in-kerenel data structures. However right
2107-
* here we must access them from the kernel image side, because
2108-
* the trap tables haven't been taken over and therefore we cannot
2109-
* take TLB misses in the PAGE_OFFSET linear mappings yet.
2110-
*/
2111-
pud = swapper_pud_dir + (shift / sizeof(pud_t));
2112-
pgd_set(&swapper_pg_dir[0], pud);
2113-
2114-
pmd = swapper_low_pmd_dir + (shift / sizeof(pmd_t));
2115-
pud_set(&swapper_pud_dir[0], pmd);
2094+
memset(swapper_pg_dir, 0, sizeof(swapper_pg_dir));
21162095

21172096
inherit_prom_mappings();
21182097

0 commit comments

Comments
 (0)