Re: [PATCH] enable interrupts in user path of page fault.



On Thu, 2007-06-07 at 18:58 -0700, Andrew Morton wrote:
On Wed, 06 Jun 2007 23:34:04 -0400

Interrupts got disabled here because do_page_fault() is an
interrupt-disabling trap, yes?

Correct.


The patch looks reasonable to me: a slight reduction in interrupt-off
latency when really weird things are happening.

The patch also breaks things, I think: if userspace is running with
interrupts disabled and tries to access kernel memory it will presently
whizz through the kernel without ever enabling interrupts. With this
change, the kernel will now enable interrupts, which is presumably not what
the application wanted.

I didn't realize that userspace was allowed to run with interrupts
disabled. If this becomes a problem, we can add the same check that's
above where do_page_fault does enable interrupts, but is skipped because
the faulting address was above PAGE_OFFSET.


ie. (i386)
if (regs->eflags & (X86_EFLAGS_IF|VM_MASK))
local_irq_enable();



However it's surely already the case that most pagefaults will go and
enable interrupts on this process anyway, so no big loss there. I'd expect
the kernel to spit piles of might_sleep() warnings when all this happens, so
maybe it just doesn't happen for some reason.

Actually it does on the RT kernel. Hence why I found it ;-)

-- Steve


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



Relevant Pages

  • Re: 2.6.12 sound problem
    ... >>of obscure kernel parameters. ... Allocating PCI resources starting at 10000000 ... Using ACPI for IRQ routing ... Using CSCINT to route CSC interrupts to PCI ...
    (Linux-Kernel)
  • Re: msi_free_irqs #2
    ... The most noticable is cciss hangs after turning on interrupts. ... The reason for ... Or perhaps git-bisect to find the offending patch. ... And just have drivers that use more the one irq walk the list off of pci_dev ...
    (Linux-Kernel)
  • Re: [PATCH] Documentation: Make fujitsu/frv/kernel-ABI.txt 80 columns wide
    ... -The internal FRV kernel ABI is not quite the same as the userspace ABI. ... -most of them do not have any scratch registers, thus requiring at least one general purpose ... +single-stepping will blithely go on stepping into things like interrupts. ... -to read and once to write), we don't actually disable interrupts at all if we don't have to. ...
    (Linux-Kernel)
  • How to avoid serial port buffer overruns?
    ... port buffer overruns quite easily if I use a baudrate high enough (I start ... Back when I was using the 2.4 kernel, ... (with disk I/O for example). ... 2/ How can I identify why the serial interrupts are delayed? ...
    (Linux-Kernel)
  • Re: kernel loading question
    ... >> decompress_kernel that decompresses the kernel starting at $0x100000. ... >> If we were loaded high, we first move the code back to $0x1000 before ... > interrupts on the current processor. ... - * Do the decompression, and jump to the new kernel.. ...
    (Linux-Kernel)