Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1672373

Re: [PATCH v3 05/11] x86/mm: Track the TLB's tlb_gen and update the flushing algorithm

From Borislav Petkov <bp@alien8.de>
Newsgroups linux.kernel
Subject Re: [PATCH v3 05/11] x86/mm: Track the TLB's tlb_gen and update the flushing algorithm
Date 2017-06-22 09:30 +0200
Message-ID <tV4IX-1sJ-37@gated-at.bofh.it> (permalink)
References <tUGnf-1Tn-3@gated-at.bofh.it> <tUGnf-1Tn-13@gated-at.bofh.it> <tUSRr-1AC-5@gated-at.bofh.it> <tV0lY-6PN-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jun 21, 2017 at 07:46:05PM -0700, Andy Lutomirski wrote:
> > I'm certainly still missing something here:
> >
> > We have f->new_tlb_gen and mm_tlb_gen to control the flushing, i.e., we
> > do once
> >
> >         bump_mm_tlb_gen(mm);
> >
> > and once
> >
> >         info.new_tlb_gen = bump_mm_tlb_gen(mm);
> >
> > and in both cases, the bumping is done on mm->context.tlb_gen.
> >
> > So why isn't that enough to do the flushing and we have to consult
> > info.new_tlb_gen too?
> 
> The issue is a possible race.  Suppose we start at tlb_gen == 1 and
> then two concurrent flushes happen.  The first flush is a full flush
> and sets tlb_gen to 2.  The second is a partial flush and sets tlb_gen
> to 3.  If the second flush gets propagated to a given CPU first and it

Maybe I'm still missing something, which is likely...

but if the second flush gets propagated to the CPU first, the CPU will
have local tlb_gen 1 and thus enforce a full flush anyway because we
will go 1 -> 3 on that particular CPU. Or?

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 05/11] x86/mm: Track the TLB's tlb_gen and update the flushing algorithm Andy Lutomirski <luto@kernel.org> - 2017-06-21 07:30 +0200
  Re: [PATCH v3 05/11] x86/mm: Track the TLB's tlb_gen and update the  flushing algorithm Thomas Gleixner <tglx@linutronix.de> - 2017-06-21 10:40 +0200
    Re: [PATCH v3 05/11] x86/mm: Track the TLB's tlb_gen and update the  flushing algorithm Andy Lutomirski <luto@kernel.org> - 2017-06-21 17:20 +0200
  Re: [PATCH v3 05/11] x86/mm: Track the TLB's tlb_gen and update the  flushing algorithm Borislav Petkov <bp@alien8.de> - 2017-06-21 20:50 +0200
    Re: [PATCH v3 05/11] x86/mm: Track the TLB's tlb_gen and update the  flushing algorithm Andy Lutomirski <luto@kernel.org> - 2017-06-22 04:50 +0200
      Re: [PATCH v3 05/11] x86/mm: Track the TLB's tlb_gen and update the  flushing algorithm Borislav Petkov <bp@alien8.de> - 2017-06-22 09:30 +0200
        Re: [PATCH v3 05/11] x86/mm: Track the TLB's tlb_gen and update the  flushing algorithm Andy Lutomirski <luto@kernel.org> - 2017-06-22 16:50 +0200
          Re: [PATCH v3 05/11] x86/mm: Track the TLB's tlb_gen and update the  flushing algorithm Borislav Petkov <bp@alien8.de> - 2017-06-22 17:00 +0200
            Re: [PATCH v3 05/11] x86/mm: Track the TLB's tlb_gen and update the  flushing algorithm Andy Lutomirski <luto@kernel.org> - 2017-06-22 18:00 +0200
              Re: [PATCH v3 05/11] x86/mm: Track the TLB's tlb_gen and update the  flushing algorithm Borislav Petkov <bp@alien8.de> - 2017-06-22 19:30 +0200
                Re: [PATCH v3 05/11] x86/mm: Track the TLB's tlb_gen and update the  flushing algorithm Andy Lutomirski <luto@kernel.org> - 2017-06-22 20:10 +0200
                Re: [PATCH v3 05/11] x86/mm: Track the TLB's tlb_gen and update the  flushing algorithm Borislav Petkov <bp@alien8.de> - 2017-06-23 10:50 +0200
                Re: [PATCH v3 05/11] x86/mm: Track the TLB's tlb_gen and update the  flushing algorithm Andy Lutomirski <luto@kernel.org> - 2017-06-23 17:50 +0200

csiph-web