Re: [PATCH 3/6] x86,tlb: make lazy TLB mode lazier

2018-06-28 Thread Rik van Riel
On Wed, 2018-06-27 at 11:10 -0700, Andy Lutomirski wrote: > > You left this comment: > > /* > * We don't currently support having a real mm loaded > without > * our cpu set in mm_cpumask(). We have all the > bookkeeping > * in pl

Re: [PATCH 3/6] x86,tlb: make lazy TLB mode lazier

2018-06-27 Thread Rik van Riel
On Wed, 2018-06-27 at 11:10 -0700, Andy Lutomirski wrote: > On Tue, Jun 26, 2018 at 10:31 AM Rik van Riel > wrote: > In general, the changes to this function are very hard to review > because you're mixing semantic changes and restructuring the > function. > Is there any way you could avoid that?

Re: [PATCH 3/6] x86,tlb: make lazy TLB mode lazier

2018-06-27 Thread Andy Lutomirski
On Tue, Jun 26, 2018 at 10:31 AM Rik van Riel wrote: > > Lazy TLB mode can result in an idle CPU being woken up by a TLB flush, > when all it really needs to do is reload %CR3 at the next context switch, > assuming no page table pages got freed. > > Memory ordering is used to prevent race conditio

[PATCH 3/6] x86,tlb: make lazy TLB mode lazier

2018-06-26 Thread Rik van Riel
Lazy TLB mode can result in an idle CPU being woken up by a TLB flush, when all it really needs to do is reload %CR3 at the next context switch, assuming no page table pages got freed. Memory ordering is used to prevent race conditions between switch_mm_irqs_off, which checks whether .tlb_gen chan