[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1181268406.10408.26.camel@localhost.localdomain>
Date: Thu, 07 Jun 2007 22:06:46 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Ingo Molnar <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>,
Christoph Hellwig <hch@...radead.org>, Andi Kleen <ak@...e.de>
Subject: 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@...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