x86/mm changes for v3.7
Linus,
Please pull the latest x86-mm-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-mm-for-linus
HEAD: fd0f5869724ff6195c6e7f12f8287c66a132e0ba x86: Distinguish TLB shootdown interrupts from other functions call interrupts
The biggest change is new TLB partial flushing code for AMD CPUs. (The v3.6 kernel had the Intel CPU side code, see commits e0ba94f14f74..effee4b9b3b.)
There's also various other refinements around the TLB flush code.
Thanks,
Ingo
------------------>
Borislav Petkov (4):
x86, cpu: Fixup tlb_flushall_shift formatting x86, cpu: Push TLB detection CPUID check down x86, cpu: Add AMD TLB size detection
x86, cpu: Preset default tlb_flushall_shift on AMD
Jan Beulich (1):
x86/mm: Fix range check in tlbflush debugfs interface
Tomoki Sekiyama (1):
x86: Distinguish TLB shootdown interrupts from other functions call interrupts
arch/x86/include/asm/hardirq.h | 4 +++ arch/x86/kernel/cpu/amd.c | 67 ++++++++++++++++++++++++++++++++++++++++++ arch/x86/kernel/cpu/common.c | 5 ++-- arch/x86/kernel/cpu/intel.c | 4 +++ arch/x86/kernel/irq.c | 4 +-- arch/x86/mm/tlb.c | 4 ++- 6 files changed, 82 insertions(+), 6 deletions(-)
arch/x86/include/asm/hardirq.h +4 -0
@@ -18,6 +18,10 @@ typedef struct {#ifdef CONFIG_SMP unsigned int irq_resched_count;unsigned int irq_call_count; +/* +* irq_tlb_count is double-counted in irq_call_count, so it must be +* subtracted from irq_call_count when displaying irq_call_count +*/ unsigned int irq_tlb_count;#endif #ifdef CONFIG_X86_THERMAL_VECTOR
arch/x86/kernel/cpu/amd.c +67 -0
79 lines not on this page · raw message
arch/x86/kernel/cpu/common.c +2 -3
@@ -474,7 +474,7 @@ void __cpuinit cpu_detect_tlb(struct cpuinfo_x86 *c) printk(KERN_INFO "Last level iTLB entries: 4KB %d, 2MB %d, 4MB %d\n" \ "Last level dTLB entries: 4KB %d, 2MB %d, 4MB %d\n" \ - "tlb_flushall_shift is 0x%x\n", + "tlb_flushall_shift: %d\n", tlb_lli_4k[ENTRIES], tlb_lli_2m[ENTRIES], tlb_lli_4m[ENTRIES], tlb_lld_4k[ENTRIES], tlb_lld_2m[ENTRIES], tlb_lld_4m[ENTRIES],
@@ -940,8 +940,7 @@ void __init identify_boot_cpu(void)#else vgetcpu_set_mode ();#endif -if (boot_cpu_data.cpuid_level >=2 ) -cpu_detect_tlb (&boot_cpu_data); +cpu_detect_tlb (&boot_cpu_data); }void __cpuinit identify_secondary_cpu (struct cpuinfo_x86 *c)
arch/x86/kernel/cpu/intel.c +4 -0
@@ -648,6 +648,10 @@ static void __cpuinit intel_detect_tlb(struct cpuinfo_x86 *c)int i, j, n;unsigned int regs[4 ];unsigned char *desc = (unsigned char *)regs; + +if (c->cpuid_level <2 ) +return ; +/* Number of times to iterate */ n =cpuid_eax (2 ) &0xFF ;
arch/x86/kernel/irq.c +2 -2
@@ -92,7 +92,8 @@ int arch_show_interrupts(struct seq_file *p, int prec)seq_printf (p," Rescheduling interrupts\n" );seq_printf (p,"%*s: " , prec,"CAL" );for_each_online_cpu (j) -seq_printf (p,"%10u " ,irq_stats (j)->irq_call_count); +seq_printf (p,"%10u " ,irq_stats (j)->irq_call_count - +irq_stats (j)->irq_tlb_count);seq_printf (p," Function call interrupts\n" );seq_printf (p,"%*s: " , prec,"TLB" );for_each_online_cpu (j)
@@ -147,7 +148,6 @@ u64 arch_irq_stat_cpu(unsigned int cpu)#ifdef CONFIG_SMP sum +=irq_stats (cpu)->irq_resched_count; sum +=irq_stats (cpu)->irq_call_count; - sum +=irq_stats (cpu)->irq_tlb_count;#endif #ifdef CONFIG_X86_THERMAL_VECTOR sum +=irq_stats (cpu)->irq_thermal_count;
arch/x86/mm/tlb.c +3 -1
@@ -98,6 +98,8 @@ static void flush_tlb_func(void *info) {struct flush_tlb_info *f = info; +inc_irq_stat (irq_tlb_count); +if (f->flush_mm !=this_cpu_read (cpu_tlbstate.active_mm))return ;
@@ -320,7 +322,7 @@ static ssize_t tlbflush_write_file(struct file *file,if (kstrtos8 (buf,0 , &shift))return -EINVAL ; -if (shift >64 ) +if (shift <-1 || shift >=BITS_PER_LONG )return -EINVAL ; tlb_flushall_shift = shift;