The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Richard Purdie <rpurdie@rpsys.net>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Should activate_page()/__set_page_dirty_buffers() use _irqsave locking?
Date: Wed, 27 Jul 2005 11:08:33 +0100	[thread overview]
Message-ID: <1122458914.7773.43.camel@localhost.localdomain> (raw)
In-Reply-To: <20050726113817.147cc074.akpm@osdl.org>

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


      reply	other threads:[~2005-07-27 10:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-26 10:56 Should activate_page()/__set_page_dirty_buffers() use _irqsave locking? Richard Purdie
2005-07-26 18:38 ` Andrew Morton
2005-07-27 10:08   ` Richard Purdie [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1122458914.7773.43.camel@localhost.localdomain \
    --to=rpurdie@rpsys.net \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox