[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5372A067.9010808@sr71.net>
Date: Tue, 13 May 2014 15:44:55 -0700
From: Dave Hansen <dave@...1.net>
To: Anthony Iliopoulos <anthony.iliopoulos@...wei.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>
CC: x86@...nel.org, linux-kernel@...r.kernel.org,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Shay Goikhman <shay.goikhman@...wei.com>,
Paul Mundt <paul.mundt@...wei.com>,
Carlos Villavieja <villavieja@....utexas.edu>,
Nacho Navarro <nacho.navarro@....es>,
Avi Mendelson <avi.mendelson@....technion.ac.il>,
Yoav Etsion <yetsion@....technion.ac.il>,
Gerald Schaefer <gerald.schaefer@...ibm.com>,
David Gibson <david@...son.dropbear.id.au>,
linux-arch <linux-arch@...r.kernel.org>
Subject: Re: [PATCH] x86, hugetlb: add missing TLB page invalidation for hugetlb_cow()
On 05/14/2014 02:29 AM, Anthony Iliopoulos wrote:
> The invalidation is required in order to maintain proper semantics
> under CoW conditions. In scenarios where a process clones several
> threads, a thread operating on a core whose DTLB entry for a
> particular hugepage has not been invalidated, will be reading from
> the hugepage that belongs to the forked child process, even after
> hugetlb_cow().
>
> The thread will not see the updated page as long as the stale DTLB
> entry remains cached, the thread attempts to write into the page,
> the child process exits, or the thread gets migrated to a different
> processor.
No to be too nitpicky, but this applies to ITLB too, right?
I believe this bug came all the way back from:
> commit 1e8f889b10d8d2223105719e36ce45688fedbd59
> Author: David Gibson <david@...son.dropbear.id.au>
> Date: Fri Jan 6 00:10:44 2006 -0800
>
> [PATCH] Hugetlb: Copy on Write support
It was probably the first time that we ever changed an _existing_
hugetlbfs pte, and that patch probably just missed the TLB flush because
none of the other pte-setting hugetlb.c code needed TLB flushes.
The bogus x86 version of huge_ptep_clear_flush() came from the s390
guys, so double-shame on IBM! :P
> commit 8fe627ec5b7c47b1654dff50536d9709863295a3
> Author: Gerald Schaefer <gerald.schaefer@...ibm.com>
> Date: Mon Apr 28 02:13:28 2008 -0700
>
> hugetlbfs: add missing TLB flush to hugetlb_cow()
This is probably an opportunity for all the other architecture
maintainers to make sure that they have proper copies of
huge_ptep_clear_flush().
I went through the hugetlb code on x86 and couldn't find another TLB
flush that fixes this issue, and I believe this is correct, so:
Acked-by: Dave Hansen <dave.hansen@...el.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists