mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shaohua Li <shaohua.li@intel.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: lkml <linux-kernel@vger.kernel.org>, clameter@sgi.com
Subject: Re: bug in migrate page
Date: Wed, 22 Aug 2007 10:50:53 +0800	[thread overview]
Message-ID: <1187751053.17976.2.camel@sli10-conroe.sh.intel.com> (raw)
In-Reply-To: <20070822115258.7d59aaa1.kamezawa.hiroyu@jp.fujitsu.com>

On Wed, 2007-08-22 at 11:52 +0900, KAMEZAWA Hiroyuki wrote:
> On Wed, 22 Aug 2007 10:08:09 +0800
> Shaohua Li <shaohua.li@intel.com> wrote:
> 
> > commit dc386d4d1e98bb39fb967ee156cd456c802fc692 adds rcu_read_lock, but
> > some routines in the lock range might sleep (like lock_buffer,
> > aops->writepage), I saw a 'sleep in atomic' warning. It appears the
> > patch has several versions before. Doing rcu_read_lock in PageAnon
> > sounds break the case of PageAnon(page) && PageSwapCache(page),
> > as .writepage might be called. The dummy anon patch maybe is ok.
> > 
> 
> Thank you for catching.
> 
> Maybe you're correct.
> 
> BTW, in PageAnon(page) && PageSwapCache(page) case, I can't find when
> .writepage is called. Could you explain ?
> 
> In my understanding,
> 
> rcu_read_lock()
> 	-> try_to_unmap()
> 	-> move_to_new_page()
> 		-> migrate_page() // swap has .migratepage member.
> 			-> migrate_page_move_mapping().
> 			-> migrate_page_copy().
> 		-> remove_migration_ptes().
> 
> 
> At quick glance, above path has no writepage() ops.
> just replace swap's radix tree entry.
I missed swap has .migratepage and thought fallback_migrate_page is
used, then I thought doing rcu lock in PageAnon case is ok.

Thanks,
Shaohua

  reply	other threads:[~2007-08-22  2:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-22  2:08 Shaohua Li
2007-08-22  2:52 ` KAMEZAWA Hiroyuki
2007-08-22  2:50   ` Shaohua Li [this message]
2007-08-22  3:06     ` KAMEZAWA Hiroyuki
2007-08-22  5:00     ` [RFC][PATCH][BUGFIX] fix rcu_read_lock in page migraton KAMEZAWA Hiroyuki
2007-08-22 18:44       ` Christoph Lameter
2007-08-22 17:50 ` bug in migrate page Christoph Lameter

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=1187751053.17976.2.camel@sli10-conroe.sh.intel.com \
    --to=shaohua.li@intel.com \
    --cc=clameter@sgi.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --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

all inboxes | Powered by JetHome®