Re: [PATCH] Athlon/Opteron Prefetch Fix for 2.6.0test5 + numbers

From: Andi Kleen (ak_at_suse.de)
Date: 09/17/03

  • Next message: Peter Chubb: "Re: laptop mode for 2.4.23-pre4 and up"
    Date:	Wed, 17 Sep 2003 22:21:00 +0200
    To: Linus Torvalds <torvalds@osdl.org>
    
    

    On Wed, Sep 17, 2003 at 12:53:59PM -0700, Linus Torvalds wrote:
    >
    > On Wed, 17 Sep 2003, Nick Piggin wrote:
    > >
    > > What is intriguing to me is the "Its only a 2% slowdown of the page
    > > fault for every cpu other than K[78] for this single workaround. There
    > > is no point to conditional compilation" attitude some people have.
    >
    > I wouldn't worry about performance as much as correctness. I'm a lot more
    > worried about the notion of taking recursive pagefaults than about 2%.

    I carefully designed it to never recurse more than once. The original
    version (before I posted it) had some corner cases that violated this, but
    the latest one is IMHO bulletproof in this regard.

    Logic is:

    when the fault came from user space as seen in CS it is ok to fault again.

    when the fault came from kernel space we must always check the exception
    table first. The __get_user is is_prefetch has an exception table entry
    and will be catched by this.
    [This is why I changed the SIGBUS path slightly - it previously did
    not follow this sequence]

    Also when the fault address is equal EIP we don't check. This avoids
    a recursion when the kernel jumps to zero. When this is not true the
    instruction is guaranteed to be mapped, because an unmapped instruction
    will always cause an page fault on EIP first.

    About the only chance of doing multiple recursions would be another CPU
    corrupting the kernel page table in parallel while the fault happens,
    but I don't see any chance to handle this properly.

    -Andi

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Peter Chubb: "Re: laptop mode for 2.4.23-pre4 and up"

    Relevant Pages

    • RE: FreeBSD 4.11 P13 Crash
      ... It happened again even with a new CPU and new PowerSupply. ... IPFilter, ... page fault while in kernel mode ... Okay this time my kernel was recompiled so there are no ...
      (freebsd-hackers)
    • Re: Panic: Fatal trap 12: page fault while in kernel mode
      ... page fault while in kernel mode ... page fault while in kernel mode ... > MP Config Base Table Entries: ... > # PCI Ethernet NICs that use the common MII bus controller code. ...
      (freebsd-current)
    • panics with 5.2.1 on single processor on dual motherboard
      ... The kernel currently has SMP, ... GNU gdb 5.2.1 ... page fault while in kernel mode ... acpi0: Overriding SCI Interrupt from IRQ 9 to IRQ 20 ...
      (freebsd-current)
    • fatal trap 12
      ... Until the kernel build and reboot occured, ... fatal trap 12: page fault ... fault virtual address: 0xc ...
      (freebsd-current)
    • Re: oops on SUSE LES9-SP2-smp on dual EM64T processor system
      ... > I am still looking into how to report this fault to SUSE. ... Don't put too much trust in the machine after the kernel has Oopsed. ... We will reboot it with nosmp until ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)