lkml.org 
[lkml]   [2018]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 5/7] x86,tlb: only send page table free TLB flush to lazy TLB CPUs
From
Date
On Fri, 2018-06-29 at 10:29 -0400, Rik van Riel wrote:
> diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
> index e59214ec52b1..c4073367219d 100644
> --- a/arch/x86/mm/tlb.c
> +++ b/arch/x86/mm/tlb.c
> @@ -718,14 +718,47 @@ void tlb_flush_remove_tables_local(void *arg)
> }
> }
>
> +static void mm_fill_lazy_tlb_cpu_mask(struct mm_struct *mm,
> + struct cpumask* lazy_cpus)
> +{
> + int cpu;
> +
> + for_each_cpu(cpu, mm_cpumask(mm)) {
> + if (!per_cpu(cpu_tlbstate.is_lazy, cpu))
> + cpumask_set_cpu(cpu, lazy_cpus);
> + }
> +}
> +
> void tlb_flush_remove_tables(struct mm_struct *mm)
> {
> int cpu = get_cpu();
> + cpumask_var_t lazy_cpus;
> +
> + if (cpumask_any_but(mm_cpumask(mm), cpu) >= nr_cpu_ids)
> + return;

A put_cpu() went missing.

> +
> + if (!zalloc_cpumask_var(&lazy_cpus, GFP_ATOMIC)) {
> + /*
> + * If the cpumask allocation fails, do a brute force flush
> + * on all the CPUs that have this mm loaded.
> + */
> + smp_call_function_many(mm_cpumask(mm),
> + tlb_flush_remove_tables_local, (void *)mm, 1);
> + return;
> + }

Ditto.

-Mike

\
 
 \ /
  Last update: 2018-07-07 14:27    [W:0.091 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site