lkml.org 
[lkml]   [2005]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Should activate_page()/__set_page_dirty_buffers() use _irqsave locking?
From
Date
On Tue, 2005-07-26 at 11:38 -0700, Andrew Morton wrote:
> Richard Purdie <rpurdie@rpsys.net> wrote:
> >
> > I've been experimenting with oprofile on an arm system without a PMU.
> > Whenever I enable callgraphing I see a BUG from run_posix_cpu_timers()
> > due to irqs being enabled when they should be disabled.
> >
> > Tracing this back shows interrupts are enabled after the arm backtrace
> > code completes. Further tracing reveals its the call to
> > check_user_page_readable() (within an interrupt) that is causing the
> > problem.
> >
> > Both the arm and i386 backtrace code would seem to be vulnerable to this
> > problem.
>
> ow, yes, ug.
>
> check_page_readable() won't actually call set_page_dirty() because it
> passes in `write = 0'. So it should be sufficient to use
> spin_lock_irqsave() in mark_page_accessed().
>
> But then again, that's fragile and obscure and it isn't even correct: if
> someone calls check_page_readable(), that doesn't imply an actual read of
> the page's contents.
>
> So how about we add a new flag to __follow_page() telling it whether to
> consider this as an access to the page contents?

The patch looks good to me, I've tested it (on arm) and it all seems to
work. I'm happy :).

Thanks,

Richard

-
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/

\
 
 \ /
  Last update: 2005-07-27 12:17    [W:0.439 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site