search for: loaded_mm

Displaying 7 results from an estimated 7 matches for "loaded_mm".

2019 Jul 22
2
[PATCH v3 4/9] x86/mm/tlb: Flush remote and local TLBs concurrently
...son = TLB_REMOTE_SHOOTDOWN; + bool local = false; + + if (f->cpu == smp_processor_id()) { + local = true; + reason = (f->mm == NULL) ? TLB_LOCAL_SHOOTDOWN : TLB_LOCAL_MM_SHOOTDOWN; + } else { + inc_irq_stat(irq_tlb_count); + + if (f->mm && f->mm != this_cpu_read(cpu_tlbstate.loaded_mm)) + return; + + count_vm_tlb_event(NR_TLB_REMOTE_FLUSH_RECEIVED); + } + + flush_tlb_func_common(f, local, reason); +} + static bool tlb_is_not_lazy(int cpu) { return !per_cpu(cpu_tlbstate_shared.is_lazy, cpu);
2019 Jul 22
2
[PATCH v3 4/9] x86/mm/tlb: Flush remote and local TLBs concurrently
...son = TLB_REMOTE_SHOOTDOWN; + bool local = false; + + if (f->cpu == smp_processor_id()) { + local = true; + reason = (f->mm == NULL) ? TLB_LOCAL_SHOOTDOWN : TLB_LOCAL_MM_SHOOTDOWN; + } else { + inc_irq_stat(irq_tlb_count); + + if (f->mm && f->mm != this_cpu_read(cpu_tlbstate.loaded_mm)) + return; + + count_vm_tlb_event(NR_TLB_REMOTE_FLUSH_RECEIVED); + } + + flush_tlb_func_common(f, local, reason); +} + static bool tlb_is_not_lazy(int cpu) { return !per_cpu(cpu_tlbstate_shared.is_lazy, cpu);
2019 Jul 02
0
[PATCH v2 4/9] x86/mm/tlb: Flush remote and local TLBs concurrently
...sh_tlb_others skipping + * This should be rare, with native_flush_tlb_multi() skipping * IPIs to lazy TLB mode CPUs. */ switch_mm_irqs_off(NULL, &init_mm, NULL); @@ -635,7 +635,7 @@ static void flush_tlb_func_common(const struct flush_tlb_info *f, this_cpu_write(cpu_tlbstate.ctxs[loaded_mm_asid].tlb_gen, mm_tlb_gen); } -static void flush_tlb_func_local(void *info) +static void __flush_tlb_func_local(void *info) { const struct flush_tlb_info *f = info; enum tlb_flush_reason reason; @@ -645,6 +645,11 @@ static void flush_tlb_func_local(void *info) flush_tlb_func_common(f, tru...
2019 Jul 22
0
[PATCH v3 4/9] x86/mm/tlb: Flush remote and local TLBs concurrently
...= false; > + > + if (f->cpu == smp_processor_id()) { > + local = true; > + reason = (f->mm == NULL) ? TLB_LOCAL_SHOOTDOWN : TLB_LOCAL_MM_SHOOTDOWN; > + } else { > + inc_irq_stat(irq_tlb_count); > + > + if (f->mm && f->mm != this_cpu_read(cpu_tlbstate.loaded_mm)) > + return; > + > + count_vm_tlb_event(NR_TLB_REMOTE_FLUSH_RECEIVED); > + } > + > + flush_tlb_func_common(f, local, reason); > +} > + > static bool tlb_is_not_lazy(int cpu) > { > return !per_cpu(cpu_tlbstate_shared.is_lazy, cpu); Nice! I will add it on top, i...
2019 Jul 19
0
[PATCH v3 4/9] x86/mm/tlb: Flush remote and local TLBs concurrently
...lb_func_remote, + flush_tlb_func_local, (void *)info, 1); } } @@ -818,16 +827,20 @@ void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start, info = get_flush_tlb_info(mm, start, end, stride_shift, freed_tables, new_tlb_gen); - if (mm == this_cpu_read(cpu_tlbstate.loaded_mm)) { + /* + * flush_tlb_multi() is not optimized for the common case in which only + * a local TLB flush is needed. Optimize this use-case by calling + * flush_tlb_func_local() directly in this case. + */ + if (cpumask_any_but(mm_cpumask(mm), cpu) < nr_cpu_ids) { + flush_tlb_multi(mm_cpumask...
2019 Jul 02
2
[PATCH v2 0/9] x86: Concurrent TLB flushes
Currently, local and remote TLB flushes are not performed concurrently, which introduces unnecessary overhead - each INVLPG can take 100s of cycles. This patch-set allows TLB flushes to be run concurrently: first request the remote CPUs to initiate the flush, then run it locally, and finally wait for the remote CPUs to finish their work. In addition, there are various small optimizations to avoid
2019 Jul 19
5
[PATCH v3 0/9] x86: Concurrent TLB flushes
[ Cover-letter is identical to v2, including benchmark results, excluding the change log. ] Currently, local and remote TLB flushes are not performed concurrently, which introduces unnecessary overhead - each INVLPG can take 100s of cycles. This patch-set allows TLB flushes to be run concurrently: first request the remote CPUs to initiate the flush, then run it locally, and finally wait for