lkml.org 
[lkml]   [2008]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH UPDATE] x86: ignore spurious faults

    * Jeremy Fitzhardinge <jeremy@goop.org> wrote:

    > Ingo Molnar wrote:
    >> thanks, applied.
    >>
    >> it would be nice to expose this ability of the architecture to the core
    >> Linux kernel mprotect code as well, and let it skip on a TLB flush when
    >> doing a RO->RW transition.
    >
    > The usermode fault handler already effectively does this; this patch
    > just does it for kernel mode as well. I don't know if mprotect takes
    > advantage of this.

    spurious faults happen all the time on SMP, in the native kernel.

    And what i mean is that Linux mprotect currently does not take advantage
    of x86's ability to just change the ptes, because there's no structured
    way to tell mm/mprotect.c that "it's safe to skip the TLB flush here".

    The flush happens in mm/mprotect.c's change_protection() function:

    flush_tlb_range(vma, start, end);

    and that is unnecessary when we increase the protection rights, such as
    in a RO->RW change. (all that is needed is an smp_wmb() instead, to make
    sure all the pte modifications are visible when the syscall returns.)

    and it's a really rare case these days that you can find an area where
    Linux does not make use of a hardware MMU feature - so we should fix
    this ;-)

    Ingo


    \
     
     \ /
      Last update: 2008-01-25 19:13    [W:4.273 / U:0.284 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site