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]
Date:   Fri, 29 Jun 2018 09:39:00 -0700
From:   Dave Hansen <dave.hansen@...ux.intel.com>
To:     Rik van Riel <riel@...riel.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 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).

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ