lkml.org 
[lkml]   [2018]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 2/7] x86,tlb: leave lazy TLB mode at page table free time
    From
    Date
    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.

    > 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).

    \
     
     \ /
      Last update: 2018-06-29 18:39    [W:4.126 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site