Re: [PATCH v2 05/10] x86/mm: Rework lazy TLB mode and TLB freshness tracking

2017-06-19 Thread Andy Lutomirski
On Tue, Jun 13, 2017 at 11:09 PM, Juergen Gross wrote: > On 14/06/17 06:56, Andy Lutomirski wrote: >> x86's lazy TLB mode used to be fairly weak -- it would switch to >> init_mm the first time it tried to flush a lazy TLB. This meant an >> unnecessary CR3 write and, if the flush was remote, an un

Re: [PATCH v2 05/10] x86/mm: Rework lazy TLB mode and TLB freshness tracking

2017-06-19 Thread Andy Lutomirski
On Sun, Jun 18, 2017 at 1:06 AM, Nadav Amit wrote: > >> On Jun 13, 2017, at 9:56 PM, Andy Lutomirski wrote: >> >> x86's lazy TLB mode used to be fairly weak -- it would switch to >> init_mm the first time it tried to flush a lazy TLB. This meant an >> unnecessary CR3 write and, if the flush was

Re: [PATCH v2 05/10] x86/mm: Rework lazy TLB mode and TLB freshness tracking

2017-06-18 Thread Nadav Amit
> On Jun 13, 2017, at 9:56 PM, Andy Lutomirski wrote: > > x86's lazy TLB mode used to be fairly weak -- it would switch to > init_mm the first time it tried to flush a lazy TLB. This meant an > unnecessary CR3 write and, if the flush was remote, an unnecessary > IPI. > > Rewrite it entirely.

Re: [PATCH v2 05/10] x86/mm: Rework lazy TLB mode and TLB freshness tracking

2017-06-14 Thread Andy Lutomirski
On Wed, Jun 14, 2017 at 3:33 PM, Dave Hansen wrote: > On 06/13/2017 09:56 PM, Andy Lutomirski wrote: >> - if (cpumask_test_cpu(cpu, &batch->cpumask)) >> + if (cpumask_test_cpu(cpu, &batch->cpumask)) { >> + local_irq_disable(); >> flush_tlb_func_local(&info, TLB_LO

Re: [PATCH v2 05/10] x86/mm: Rework lazy TLB mode and TLB freshness tracking

2017-06-14 Thread Dave Hansen
On 06/13/2017 09:56 PM, Andy Lutomirski wrote: > - if (cpumask_test_cpu(cpu, &batch->cpumask)) > + if (cpumask_test_cpu(cpu, &batch->cpumask)) { > + local_irq_disable(); > flush_tlb_func_local(&info, TLB_LOCAL_SHOOTDOWN); > + local_irq_enable(); > +

Re: [PATCH v2 05/10] x86/mm: Rework lazy TLB mode and TLB freshness tracking

2017-06-13 Thread Juergen Gross
On 14/06/17 06:56, Andy Lutomirski wrote: > x86's lazy TLB mode used to be fairly weak -- it would switch to > init_mm the first time it tried to flush a lazy TLB. This meant an > unnecessary CR3 write and, if the flush was remote, an unnecessary > IPI. > > Rewrite it entirely. When we enter laz

[PATCH v2 05/10] x86/mm: Rework lazy TLB mode and TLB freshness tracking

2017-06-13 Thread Andy Lutomirski
x86's lazy TLB mode used to be fairly weak -- it would switch to init_mm the first time it tried to flush a lazy TLB. This meant an unnecessary CR3 write and, if the flush was remote, an unnecessary IPI. Rewrite it entirely. When we enter lazy mode, we simply remove the cpu from mm_cpumask. Thi