lkml.org 
[lkml]   [2008]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [kerneloops] regression in 2.6.27 wrt "lock_page" and the "hwclock" program


On Sat, 4 Oct 2008, Andrew Morton wrote:
> > Pid: 9591, comm: hwclock Tainted: G W 2.6.27-0.372.rc8.fc10.i686 #1
> > [<c0427a53>] __might_sleep+0xd1/0xd6
> > [<c0479a8b>] lock_page+0x1a/0x34
> > [<c0479cfa>] find_lock_page+0x23/0x48
> > [<c047a215>] filemap_fault+0x9b/0x330
> > [<c0486493>] __do_fault+0x40/0x2e6
> > [<c0487d63>] handle_mm_fault+0x2ec/0x6d2
> > [<c06e8260>] do_page_fault+0x2e5/0x693
>
> Looks like `hwclock' disabled interrupts in userspace with sys_iopl()?

We probably should enable interrupts in the page fault code. We already do

#ifdef CONFIG_X86_32
/* It's safe to allow irq's after cr2 has been saved and the vmalloc
fault has been handled. */
if (regs->flags & (X86_EFLAGS_IF | X86_VM_MASK))
local_irq_enable();

/*
* If we're in an interrupt, have no user context or are running in an
* atomic region then we must not take the fault.
*/
if (in_atomic() || !mm)
goto bad_area_nosemaphore;
#endif
...

so we have code to do so, it's just that we don't do it if the page fault
happened in an interrupt. But that's for the _kernel_ having interrupts
disabled and us needing to fix up the vmalloc area lazily (do we ever even
do that any more.. I dunno).

So we could easily add a check for 'user_space_vm(regs)' instead of
checking the VM_MASK, and fix it that way. Hmm?

Linus


\
 
 \ /
  Last update: 2008-10-05 20:21    [W:0.084 / U:2.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site