lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1530291383.16379.6.camel@surriel.com>
Date:   Fri, 29 Jun 2018 12:56:23 -0400
From:   Rik van Riel <riel@...riel.com>
To:     Dave Hansen <dave.hansen@...ux.intel.com>,
        linux-kernel@...r.kernel.org
Cc:     x86@...nel.org, luto@...nel.org, mingo@...nel.org,
        kernel-team@...com, tglx@...utronix.de, efault@....de,
        songliubraving@...com, hpa@...or.com
Subject: Re: [PATCH 2/7] x86,tlb: leave lazy TLB mode at page table free time

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.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ