Patch "sparc64: Kill unnecessary tables and increase MAX_BANKS." has been added to the 3.16-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    sparc64: Kill unnecessary tables and increase MAX_BANKS.

to the 3.16-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sparc64-kill-unnecessary-tables-and-increase-max_banks.patch
and it can be found in the queue-3.16 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From foo@baz Tue Oct 28 11:19:22 CST 2014
From: "David S. Miller" <davem@xxxxxxxxxxxxx>
Date: Sat, 27 Sep 2014 21:30:57 -0700
Subject: sparc64: Kill unnecessary tables and increase MAX_BANKS.

From: "David S. Miller" <davem@xxxxxxxxxxxxx>

[ Upstream commit d195b71bad4347d2df51072a537f922546a904f1 ]

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 <davem@xxxxxxxxxxxxx>
Acked-by: Bob Picco <bob.picco@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 arch/sparc/include/asm/pgtable_64.h |    1 -
 arch/sparc/kernel/vmlinux.lds.S     |    5 +++--
 arch/sparc/mm/init_64.c             |   25 ++-----------------------
 3 files changed, 5 insertions(+), 26 deletions(-)

--- a/arch/sparc/include/asm/pgtable_64.h
+++ b/arch/sparc/include/asm/pgtable_64.h
@@ -927,7 +927,6 @@ static inline void __set_pte_at(struct m
 #endif
 
 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
-extern pmd_t swapper_low_pmd_dir[PTRS_PER_PMD];
 
 void paging_init(void);
 unsigned long find_ecache_flush_span(unsigned long size);
--- a/arch/sparc/kernel/vmlinux.lds.S
+++ b/arch/sparc/kernel/vmlinux.lds.S
@@ -35,8 +35,9 @@ jiffies = jiffies_64;
 
 SECTIONS
 {
-	/* swapper_low_pmd_dir is sparc64 only */
-	swapper_low_pmd_dir = 0x0000000000402000;
+#ifdef CONFIG_SPARC64
+	swapper_pg_dir = 0x0000000000402000;
+#endif
 	. = INITIAL_ADDRESS;
 	.text TEXTSTART :
 	{
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -86,7 +86,7 @@ extern struct tsb swapper_tsb[KERNEL_TSB
 
 static unsigned long cpu_pgsz_mask;
 
-#define MAX_BANKS	32
+#define MAX_BANKS	1024
 
 static struct linux_prom64_registers pavail[MAX_BANKS];
 static int pavail_ents;
@@ -1942,12 +1942,6 @@ static void __init sun4v_linear_pte_xor_
 
 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 sun4v_pgprot_init(void);
 
@@ -1955,8 +1949,6 @@ void __init paging_init(void)
 {
 	unsigned long end_pfn, shift, phys_base;
 	unsigned long real_end, i;
-	pud_t *pud;
-	pmd_t *pmd;
 	int node;
 
 	setup_page_offset();
@@ -2051,20 +2043,7 @@ void __init paging_init(void)
 	 */
 	init_mm.pgd += ((shift) / (sizeof(pgd_t)));
 	
-	memset(swapper_low_pmd_dir, 0, sizeof(swapper_low_pmd_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);
+	memset(swapper_pg_dir, 0, sizeof(swapper_pg_dir));
 
 	inherit_prom_mappings();
 	


Patches currently in stable-queue which might be from davem@xxxxxxxxxxxxx are

queue-3.16/sparc64-adjust-vmalloc-region-size-based-upon-available-virtual-address-bits.patch
queue-3.16/sparc64-fix-fpu-register-corruption-with-aes-crypto-offload.patch
queue-3.16/sparc64-move-request_irq-from-ldc_bind-to-ldc_alloc.patch
queue-3.16/sparc32-dma_alloc_coherent-must-honour-gfp-flags.patch
queue-3.16/sparc64-kill-unnecessary-tables-and-increase-max_banks.patch
queue-3.16/sparc-let-memset-return-the-address-argument.patch
queue-3.16/sparc64-use-kernel-page-tables-for-vmemmap.patch
queue-3.16/sparc64-sparse-irq.patch
queue-3.16/sparc64-fix-physical-memory-management-regressions-with-large-max_phys_bits.patch
queue-3.16/sparc64-fix-lockdep-warnings-on-reboot-on-ultra-5.patch
queue-3.16/sparc64-switch-to-4-level-page-tables.patch
queue-3.16/sparc64-sun4v-tlb-error-power-off-events.patch
queue-3.16/sparc-bpf_jit-fix-support-for-ldx-stx-mem-and-skf_ad_vlan_tag.patch
queue-3.16/sparc64-increase-size-of-boot-string-to-1024-bytes.patch
queue-3.16/sparc64-find_node-adjustment.patch
queue-3.16/sparc64-fix-reversed-start-end-in-flush_tlb_kernel_range.patch
queue-3.16/sparc64-increase-max_phys_address_bits-to-53.patch
queue-3.16/sparc64-define-va-hole-at-run-time-rather-than-at-compile-time.patch
queue-3.16/sparc64-fix-register-corruption-in-top-most-kernel-stack-frame-during-boot.patch
queue-3.16/sparc64-do-not-disable-interrupts-in-nmi_cpu_busy.patch
queue-3.16/sparc64-support-m6-and-m7-for-building-cpu-distribution-map.patch
queue-3.16/sparc64-cpu-hardware-caps-support-for-sparc-m6-and-m7.patch
queue-3.16/sparc64-do-not-define-thread-fpregs-save-area-as-zero-length-array.patch
queue-3.16/sparc-bpf_jit-fix-loads-from-negative-offsets.patch
queue-3.16/sparc64-t5-pmu.patch
queue-3.16/sparc64-adjust-ktsb-assembler-to-support-larger-physical-addresses.patch
queue-3.16/sparc64-implement-__get_user_pages_fast.patch
queue-3.16/sparc64-fix-corrupted-thread-fault-code.patch
queue-3.16/sparc64-fix-hibernation-code-refrence-to-page_offset.patch
queue-3.16/sparc64-correctly-recognise-m6-and-m7-cpu-type.patch
queue-3.16/sparc64-fix-pcr_ops-initialization-and-usage-bugs.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]