linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Swamy Gowda <swamy@virident.com>,
	linux-kernel@vger.kernel.org, cl@linux-foundation.org,
	Brice.Goglin@inria.fr, "linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: [RFC][PATCH] release mmap_sem before starting migration (Was Re: Need to take mmap_sem lock in move_pages.
Date: Wed, 4 Feb 2009 18:55:01 +0900	[thread overview]
Message-ID: <20090204185501.837ff5d6.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <20090204184028.09a4bbae.kamezawa.hiroyu@jp.fujitsu.com>

On Wed, 4 Feb 2009 18:40:28 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:

> On Wed, 4 Feb 2009 18:36:00 +0900
> KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
>       Maybe up_read() can be moved before do_migrate_pages(), I think.
> 
How about this ?
==

mmap_sem can be released after page table walk ends.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
 mm/migrate.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: mmotm-2.6.29-Feb03/mm/migrate.c
===================================================================
--- mmotm-2.6.29-Feb03.orig/mm/migrate.c
+++ mmotm-2.6.29-Feb03/mm/migrate.c
@@ -875,13 +875,13 @@ put_and_set:
 set_status:
 		pp->status = err;
 	}
+	up_read(&mm->mmap_sem);
 
 	err = 0;
 	if (!list_empty(&pagelist))
 		err = migrate_pages(&pagelist, new_page_node,
 				(unsigned long)pm);
 
-	up_read(&mm->mmap_sem);
 	return err;
 }
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

       reply	other threads:[~2009-02-04  9:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <28631E6913C8074E95A698E8AC93D091B21561@caexch1.virident.info>
     [not found] ` <20090204183600.f41e8b7e.kamezawa.hiroyu@jp.fujitsu.com>
     [not found]   ` <20090204184028.09a4bbae.kamezawa.hiroyu@jp.fujitsu.com>
2009-02-04  9:55     ` KAMEZAWA Hiroyuki [this message]
2009-02-04 15:39       ` Christoph Lameter
2009-02-05  1:15         ` KAMEZAWA Hiroyuki
2009-02-05 12:23           ` Swamy Gowda
2009-02-05 13:23             ` KAMEZAWA Hiroyuki

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=20090204185501.837ff5d6.kamezawa.hiroyu@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=Brice.Goglin@inria.fr \
    --cc=cl@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=swamy@virident.com \
    /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