[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55704D15.3030309@huawei.com>
Date: Thu, 4 Jun 2015 21:05:25 +0800
From: Xishi Qiu <qiuxishi@...wei.com>
To: Xishi Qiu <qiuxishi@...wei.com>,
Andrew Morton <akpm@...ux-foundation.org>,
<nao.horiguchi@...il.com>, Yinghai Lu <yinghai@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>, <mingo@...e.hu>,
Xiexiuqi <xiexiuqi@...wei.com>,
Hanjun Guo <guohanjun@...wei.com>,
"Luck, Tony" <tony.luck@...el.com>
CC: Linux MM <linux-mm@...ck.org>, LKML <linux-kernel@...r.kernel.org>
Subject: [RFC PATCH 12/12] mm: let slab/slub/slob use mirrored memory
Add __GFP_MIRROR flag when allocate a new slab.
Signed-off-by: Xishi Qiu <qiuxishi@...wei.com>
---
mm/slab.c | 3 ++-
mm/slob.c | 2 +-
mm/slub.c | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/mm/slab.c b/mm/slab.c
index 7eb38dd..3b3ef22 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1594,7 +1594,8 @@ static struct page *kmem_getpages(struct kmem_cache *cachep, gfp_t flags,
if (memcg_charge_slab(cachep, flags, cachep->gfporder))
return NULL;
- page = alloc_pages_exact_node(nodeid, flags | __GFP_NOTRACK, cachep->gfporder);
+ page = alloc_pages_exact_node(nodeid, flags | __GFP_NOTRACK | __GFP_MIRROR,
+ cachep->gfporder);
if (!page) {
memcg_uncharge_slab(cachep, cachep->gfporder);
slab_out_of_memory(cachep, flags, nodeid);
diff --git a/mm/slob.c b/mm/slob.c
index 4765f65..4ff9bde 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -452,7 +452,7 @@ __do_kmalloc_node(size_t size, gfp_t gfp, int node, unsigned long caller)
if (likely(order))
gfp |= __GFP_COMP;
- ret = slob_new_pages(gfp, order, node);
+ ret = slob_new_pages(gfp | __GFP_MIRROR, order, node);
trace_kmalloc_node(caller, ret,
size, PAGE_SIZE << order, gfp, node);
diff --git a/mm/slub.c b/mm/slub.c
index 54c0876..1219e33 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1315,7 +1315,7 @@ static inline struct page *alloc_slab_page(struct kmem_cache *s,
struct page *page;
int order = oo_order(oo);
- flags |= __GFP_NOTRACK;
+ flags |= __GFP_NOTRACK | __GFP_MIRROR;
if (memcg_charge_slab(s, flags, order))
return NULL;
--
2.0.0
--
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