From: Christoph Lameter <cl@linux-foundation.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
heiko.carstens@de.ibm.com, npiggin@suse.de,
linux-kernel@vger.kernel.org, hugh@veritas.com,
torvalds@linux-foundation.org, riel@redhat.com,
lee.schermerhorn@hp.com, linux-mm@kvack.org
Subject: Re: [RFC][PATCH] lru_add_drain_all() don't use schedule_on_each_cpu()
Date: Tue, 28 Oct 2008 09:25:31 -0500 (CDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0810280914010.15939@quilx.com> (raw)
In-Reply-To: <20081027145509.ebffcf0e.akpm@linux-foundation.org>
On Mon, 27 Oct 2008, Andrew Morton wrote:
> Can we fix that instead?
How about this fix?
Subject: Move migrate_prep out from under mmap_sem
Move the migrate_prep outside the mmap_sem for the following system calls
1. sys_move_pages
2. sys_migrate_pages
3. sys_mbind()
It really does not matter when we flush the lru. The system is free to add
pages onto the lru even during migration which will make the page
migration either skip the page (mbind, migrate_pages) or return a busy
state (move_pages).
Signed-off-by: Christoph Lameter <cl@linux-foundation.org>
Index: linux-2.6/mm/mempolicy.c
===================================================================
--- linux-2.6.orig/mm/mempolicy.c 2008-10-28 09:16:18.475514878 -0500
+++ linux-2.6/mm/mempolicy.c 2008-10-28 09:22:46.486773874 -0500
@@ -489,12 +489,6 @@
int err;
struct vm_area_struct *first, *vma, *prev;
- if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) {
-
- err = migrate_prep();
- if (err)
- return ERR_PTR(err);
- }
first = find_vma(mm, start);
if (!first)
@@ -809,9 +803,13 @@
const nodemask_t *from_nodes, const nodemask_t *to_nodes, int flags)
{
int busy = 0;
- int err = 0;
+ int err;
nodemask_t tmp;
+ err = migrate_prep();
+ if (err)
+ return err;
+
down_read(&mm->mmap_sem);
err = migrate_vmas(mm, from_nodes, to_nodes, flags);
@@ -974,6 +972,12 @@
start, start + len, mode, mode_flags,
nmask ? nodes_addr(*nmask)[0] : -1);
+ if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) {
+
+ err = migrate_prep();
+ if (err)
+ return err;
+ }
down_write(&mm->mmap_sem);
vma = check_range(mm, start, end, nmask,
flags | MPOL_MF_INVERT, &pagelist);
Index: linux-2.6/mm/migrate.c
===================================================================
--- linux-2.6.orig/mm/migrate.c 2008-10-28 09:15:46.578013464 -0500
+++ linux-2.6/mm/migrate.c 2008-10-28 09:16:14.038014180 -0500
@@ -841,12 +841,12 @@
struct page_to_node *pp;
LIST_HEAD(pagelist);
+ migrate_prep();
down_read(&mm->mmap_sem);
/*
* Build a list of pages to migrate
*/
- migrate_prep();
for (pp = pm; pp->node != MAX_NUMNODES; pp++) {
struct vm_area_struct *vma;
struct page *page;
--
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>
next prev parent reply other threads:[~2008-10-28 14:25 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200810201659.m9KGxtFC016280@hera.kernel.org>
2008-10-21 15:13 ` mlock: mlocked pages are unevictable Heiko Carstens
2008-10-21 15:51 ` KOSAKI Motohiro
2008-10-21 17:18 ` KOSAKI Motohiro
2008-10-21 20:30 ` Peter Zijlstra
2008-10-21 20:48 ` Peter Zijlstra
2008-10-23 15:00 ` [RFC][PATCH] lru_add_drain_all() don't use schedule_on_each_cpu() KOSAKI Motohiro
2008-10-24 1:28 ` Nick Piggin
2008-10-24 4:54 ` KOSAKI Motohiro
2008-10-24 4:55 ` Nick Piggin
2008-10-24 5:29 ` KOSAKI Motohiro
2008-10-24 5:34 ` Nick Piggin
2008-10-24 5:51 ` KOSAKI Motohiro
2008-10-24 19:20 ` Heiko Carstens
2008-10-26 11:06 ` Peter Zijlstra
2008-10-26 13:37 ` KOSAKI Motohiro
2008-10-26 13:49 ` Peter Zijlstra
2008-10-26 15:51 ` KOSAKI Motohiro
2008-10-26 16:17 ` Peter Zijlstra
2008-10-27 3:14 ` KOSAKI Motohiro
2008-10-27 7:56 ` Peter Zijlstra
2008-10-27 8:03 ` KOSAKI Motohiro
2008-10-27 10:42 ` KOSAKI Motohiro
2008-10-27 21:55 ` Andrew Morton
2008-10-28 14:25 ` Christoph Lameter [this message]
2008-10-28 20:45 ` Andrew Morton
2008-10-28 21:29 ` Lee Schermerhorn
2008-10-29 7:17 ` KOSAKI Motohiro
2008-10-29 12:40 ` Lee Schermerhorn
2008-11-06 0:14 ` [PATCH] get rid of lru_add_drain_all() in munlock path KOSAKI Motohiro
2008-11-06 16:33 ` Kamalesh Babulal
2008-10-29 7:20 ` [RFC][PATCH] lru_add_drain_all() don't use schedule_on_each_cpu() KOSAKI Motohiro
2008-10-29 8:21 ` KAMEZAWA Hiroyuki
2008-11-05 9:51 ` Peter Zijlstra
2008-11-05 9:55 ` KOSAKI Motohiro
2008-10-22 15:28 ` mlock: mlocked pages are unevictable Lee Schermerhorn
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=Pine.LNX.4.64.0810280914010.15939@quilx.com \
--to=cl@linux-foundation.org \
--cc=akpm@linux-foundation.org \
--cc=heiko.carstens@de.ibm.com \
--cc=hugh@veritas.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=lee.schermerhorn@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@suse.de \
--cc=riel@redhat.com \
--cc=torvalds@linux-foundation.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