Messages in this thread | | | Subject | Re: [PATCH 2/7] x86,tlb: leave lazy TLB mode at page table free time | From | Rik van Riel <> | Date | Fri, 29 Jun 2018 12:56:23 -0400 |
| |
On Fri, 2018-06-29 at 09:39 -0700, Dave Hansen wrote: > On 06/29/2018 07:29 AM, Rik van Riel wrote: > > The latter problem can be prevented in two ways. The first is to > > always send a TLB shootdown IPI to CPUs in lazy TLB mode, while > > the second one is to only send the TLB shootdown at page table > > freeing time. > > I've read this a few times, and I keep having to remind myself why we > "always send a TLB shootdown IPI to CPUs in lazy TLB mode". It's not > strictly CPUs in lazy TLB mode, right? It's just the one that are in > lazy TLB mode _and_ using the mm from which we are freeing page > tables. > > If you revise these again, would it make sense to add a little blurb > like: > > CPUs in lazy TLB mode are using the "wrong" page tables, > generally from a process's mm while running true kernel code > like the idle task. This is just as problematic when freeing > page tables from that mm as a real non-lazy user of the page > tables would be.
If we get to a v4, I will do that.
> > The second should result in fewer IPIs, since operationgs like > > mprotect and madvise are very common with some workloads, but > > do not involve page table freeing. Also, on munmap, batching > > of page table freeing covers much larger ranges of virtual > > memory than the batching of unmapped user pages. > > Doesn't this also result in fewer IPIs because it *removes* the > processor from the mm_cpumask(mm) and won't send IPIs to it any more? > As it stood before, we'd IPI a lazy CPU over and over, but this way > we > just do it once, switch to another mm, and never touch for this mm > again > (unless that CPU becomes non-lazy and switches to that mm again).
With this patch series, we never remove a CPU from the mm_cpumask(mm) while in lazy TLB mode, but we also do not send TLB shootdowns too CPUs in lazy TLB mode, unless we are freeing page tables - when that happens, the CPU will remove itself from the mm_cpumask.
-- All Rights Reversed.[unhandled content-type:application/pgp-signature] | |