Re: [PATCH 5/7] x86,tlb: only send page table free TLB flush to lazy TLB CPUs

From: Rik van Riel
Date: Sat Jul 07 2018 - 17:21:40 EST


On Sat, 2018-07-07 at 14:26 +0200, Mike Galbraith wrote:
> 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.

Doh!

Thank you for spotting that, I will fix
that in the next version!

--
All Rights Reversed.

Attachment: signature.asc
Description: This is a digitally signed message part