[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <49547B93.5090905@cn.fujitsu.com>
Date: Fri, 26 Dec 2008 14:37:07 +0800
From: Miao Xie <miaox@...fujitsu.com>
To: Paul Menage <menage@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Christoph Lameter <cl@...ux-foundation.org>,
Pekka Enberg <penberg@...helsinki.fi>,
Matt Mackall <mpm@...enic.com>
CC: Linux-Kernel <linux-kernel@...r.kernel.org>,
Linux-MM <linux-mm@...ck.org>
Subject: [PATCH] cpuset,mm: fix allocating page cache/slab object on the unallowed
node when memory spread is set
The task still allocated the page caches on old node after modifying its
cpuset's mems when 'memory_spread_page' was set, it is caused by the old
mem_allowed_list of the task. Slab has the same problem.
This patch fixes this bug.
Signed-off-by: Miao Xie <miaox@...fujitsu.com>
---
mm/filemap.c | 3 +++
mm/slab.c | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/mm/filemap.c b/mm/filemap.c
index f3e5f89..d978983 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -517,6 +517,9 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
#ifdef CONFIG_NUMA
struct page *__page_cache_alloc(gfp_t gfp)
{
+ if ((gfp & __GFP_WAIT) && !in_interrupt())
+ cpuset_update_task_memory_state();
+
if (cpuset_do_page_mem_spread()) {
int n = cpuset_mem_spread_node();
return alloc_pages_node(n, gfp, 0);
diff --git a/mm/slab.c b/mm/slab.c
index 0918751..3b6e3d7 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3460,6 +3460,9 @@ __cache_alloc(struct kmem_cache *cachep, gfp_t flags, void *caller)
if (should_failslab(cachep, flags))
return NULL;
+ if ((flags & __GFP_WAIT) && !in_interrupt())
+ cpuset_update_task_memory_state();
+
cache_alloc_debugcheck_before(cachep, flags);
local_irq_save(save_flags);
objp = __do_cache_alloc(cachep, flags);
--
1.5.4.rc3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists