* [PATCH v2] Remove node's validity check in alloc_pages
@ 2010-04-14 14:58 ` Minchan Kim
0 siblings, 0 replies; 14+ messages in thread
From: Minchan Kim @ 2010-04-14 14:58 UTC (permalink / raw)
To: Andrew Morton
Cc: Mel Gorman, KAMEZAWA Hiroyuki, Bob Liu, linux-kernel, linux-mm,
Minchan Kim
V2
* Add some reviewed-by
alloc_pages calls alloc_pages_node with numa_node_id().
alloc_pages_node can't see nid < 0.
So we can use alloc_pages_exact_node instead of alloc_pages_node.
It could avoid comparison and branch as 6484eb3e2a81807722 tried.
Reviewed-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujisu.com>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
include/linux/gfp.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 4c6d413..b65f003 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -308,7 +308,7 @@ extern struct page *alloc_page_vma(gfp_t gfp_mask,
struct vm_area_struct *vma, unsigned long addr);
#else
#define alloc_pages(gfp_mask, order) \
- alloc_pages_node(numa_node_id(), gfp_mask, order)
+ alloc_pages_exact_node(numa_node_id(), gfp_mask, order)
#define alloc_page_vma(gfp_mask, vma, addr) alloc_pages(gfp_mask, 0)
#endif
#define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0)
--
1.7.0.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v2] Remove node's validity check in alloc_pages
@ 2010-04-14 14:58 ` Minchan Kim
0 siblings, 0 replies; 14+ messages in thread
From: Minchan Kim @ 2010-04-14 14:58 UTC (permalink / raw)
To: Andrew Morton
Cc: Mel Gorman, KAMEZAWA Hiroyuki, Bob Liu, linux-kernel, linux-mm,
Minchan Kim
V2
* Add some reviewed-by
alloc_pages calls alloc_pages_node with numa_node_id().
alloc_pages_node can't see nid < 0.
So we can use alloc_pages_exact_node instead of alloc_pages_node.
It could avoid comparison and branch as 6484eb3e2a81807722 tried.
Reviewed-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujisu.com>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
include/linux/gfp.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 4c6d413..b65f003 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -308,7 +308,7 @@ extern struct page *alloc_page_vma(gfp_t gfp_mask,
struct vm_area_struct *vma, unsigned long addr);
#else
#define alloc_pages(gfp_mask, order) \
- alloc_pages_node(numa_node_id(), gfp_mask, order)
+ alloc_pages_exact_node(numa_node_id(), gfp_mask, order)
#define alloc_page_vma(gfp_mask, vma, addr) alloc_pages(gfp_mask, 0)
#endif
#define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0)
--
1.7.0.5
--
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>
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH] change alloc function in pcpu_alloc_pages
2010-04-14 14:58 ` Minchan Kim
@ 2010-04-14 14:58 ` Minchan Kim
-1 siblings, 0 replies; 14+ messages in thread
From: Minchan Kim @ 2010-04-14 14:58 UTC (permalink / raw)
To: Andrew Morton
Cc: Mel Gorman, KAMEZAWA Hiroyuki, Bob Liu, linux-kernel, linux-mm,
Minchan Kim, Tejun Heo, Christoph Lameter
alloc_pages_node is called with cpu_to_node(cpu).
I think cpu_to_node(cpu) never returns -1.
(But I am not sure we need double check.)
So we can use alloc_pages_exact_node instead of alloc_pages_node.
It could avoid comparison and branch as 6484eb3e2a81807722 tried.
Cc: Tejun Heo <tj@kernel.org>
Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
mm/percpu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/percpu.c b/mm/percpu.c
index 768419d..ec3e671 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -720,7 +720,7 @@ static int pcpu_alloc_pages(struct pcpu_chunk *chunk,
for (i = page_start; i < page_end; i++) {
struct page **pagep = &pages[pcpu_page_idx(cpu, i)];
- *pagep = alloc_pages_node(cpu_to_node(cpu), gfp, 0);
+ *pagep = alloc_pages_exact_node(cpu_to_node(cpu), gfp, 0);
if (!*pagep) {
pcpu_free_pages(chunk, pages, populated,
page_start, page_end);
--
1.7.0.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH] change alloc function in pcpu_alloc_pages
@ 2010-04-14 14:58 ` Minchan Kim
0 siblings, 0 replies; 14+ messages in thread
From: Minchan Kim @ 2010-04-14 14:58 UTC (permalink / raw)
To: Andrew Morton
Cc: Mel Gorman, KAMEZAWA Hiroyuki, Bob Liu, linux-kernel, linux-mm,
Minchan Kim, Tejun Heo, Christoph Lameter
alloc_pages_node is called with cpu_to_node(cpu).
I think cpu_to_node(cpu) never returns -1.
(But I am not sure we need double check.)
So we can use alloc_pages_exact_node instead of alloc_pages_node.
It could avoid comparison and branch as 6484eb3e2a81807722 tried.
Cc: Tejun Heo <tj@kernel.org>
Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
mm/percpu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/percpu.c b/mm/percpu.c
index 768419d..ec3e671 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -720,7 +720,7 @@ static int pcpu_alloc_pages(struct pcpu_chunk *chunk,
for (i = page_start; i < page_end; i++) {
struct page **pagep = &pages[pcpu_page_idx(cpu, i)];
- *pagep = alloc_pages_node(cpu_to_node(cpu), gfp, 0);
+ *pagep = alloc_pages_exact_node(cpu_to_node(cpu), gfp, 0);
if (!*pagep) {
pcpu_free_pages(chunk, pages, populated,
page_start, page_end);
--
1.7.0.5
--
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>
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v2] change alloc function in alloc_slab_page
2010-04-14 14:58 ` Minchan Kim
@ 2010-04-14 14:58 ` Minchan Kim
-1 siblings, 0 replies; 14+ messages in thread
From: Minchan Kim @ 2010-04-14 14:58 UTC (permalink / raw)
To: Andrew Morton
Cc: Mel Gorman, KAMEZAWA Hiroyuki, Bob Liu, linux-kernel, linux-mm,
Minchan Kim, Pekka Enberg, Christoph Lameter
V2
* change changelog
* Add some reviewed-by
alloc_slab_page always checks nid == -1, so alloc_page_node can't be
called with -1.
It means node's validity check in alloc_pages_node is unnecessary.
So we can use alloc_pages_exact_node instead of alloc_pages_node.
It could avoid comparison and branch as 6484eb3e2a81807722 tried.
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Mel Gorman <mel@csn.ul.ie>
---
mm/slub.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index b364844..9984165 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1084,7 +1084,7 @@ static inline struct page *alloc_slab_page(gfp_t flags, int node,
if (node == -1)
return alloc_pages(flags, order);
else
- return alloc_pages_node(node, flags, order);
+ return alloc_pages_exact_node(node, flags, order);
}
static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
--
1.7.0.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v2] change alloc function in alloc_slab_page
@ 2010-04-14 14:58 ` Minchan Kim
0 siblings, 0 replies; 14+ messages in thread
From: Minchan Kim @ 2010-04-14 14:58 UTC (permalink / raw)
To: Andrew Morton
Cc: Mel Gorman, KAMEZAWA Hiroyuki, Bob Liu, linux-kernel, linux-mm,
Minchan Kim, Pekka Enberg, Christoph Lameter
V2
* change changelog
* Add some reviewed-by
alloc_slab_page always checks nid == -1, so alloc_page_node can't be
called with -1.
It means node's validity check in alloc_pages_node is unnecessary.
So we can use alloc_pages_exact_node instead of alloc_pages_node.
It could avoid comparison and branch as 6484eb3e2a81807722 tried.
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Mel Gorman <mel@csn.ul.ie>
---
mm/slub.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index b364844..9984165 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1084,7 +1084,7 @@ static inline struct page *alloc_slab_page(gfp_t flags, int node,
if (node == -1)
return alloc_pages(flags, order);
else
- return alloc_pages_node(node, flags, order);
+ return alloc_pages_exact_node(node, flags, order);
}
static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
--
1.7.0.5
--
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>
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v2] change alloc function in vmemmap_alloc_block
2010-04-14 14:58 ` Minchan Kim
@ 2010-04-14 14:58 ` Minchan Kim
-1 siblings, 0 replies; 14+ messages in thread
From: Minchan Kim @ 2010-04-14 14:58 UTC (permalink / raw)
To: Andrew Morton
Cc: Mel Gorman, KAMEZAWA Hiroyuki, Bob Liu, linux-kernel, linux-mm,
Minchan Kim, Christoph Lameter
V2
* Add some reviewed-by
if node_state is N_HIGH_MEMORY, node doesn't have -1.
It means node's validity check is unnecessary.
So we can use alloc_pages_exact_node instead of alloc_pages_node.
It could avoid comparison and branch as 6484eb3e2a81807722 tried.
Cc: Christoph Lameter <cl@linux-foundation.org>
Reviewed-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
mm/sparse-vmemmap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
index 392b9bb..7710ebc 100644
--- a/mm/sparse-vmemmap.c
+++ b/mm/sparse-vmemmap.c
@@ -53,7 +53,7 @@ void * __meminit vmemmap_alloc_block(unsigned long size, int node)
struct page *page;
if (node_state(node, N_HIGH_MEMORY))
- page = alloc_pages_node(node,
+ page = alloc_pages_exact_node(node,
GFP_KERNEL | __GFP_ZERO, get_order(size));
else
page = alloc_pages(GFP_KERNEL | __GFP_ZERO,
--
1.7.0.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v2] change alloc function in vmemmap_alloc_block
@ 2010-04-14 14:58 ` Minchan Kim
0 siblings, 0 replies; 14+ messages in thread
From: Minchan Kim @ 2010-04-14 14:58 UTC (permalink / raw)
To: Andrew Morton
Cc: Mel Gorman, KAMEZAWA Hiroyuki, Bob Liu, linux-kernel, linux-mm,
Minchan Kim, Christoph Lameter
V2
* Add some reviewed-by
if node_state is N_HIGH_MEMORY, node doesn't have -1.
It means node's validity check is unnecessary.
So we can use alloc_pages_exact_node instead of alloc_pages_node.
It could avoid comparison and branch as 6484eb3e2a81807722 tried.
Cc: Christoph Lameter <cl@linux-foundation.org>
Reviewed-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
mm/sparse-vmemmap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
index 392b9bb..7710ebc 100644
--- a/mm/sparse-vmemmap.c
+++ b/mm/sparse-vmemmap.c
@@ -53,7 +53,7 @@ void * __meminit vmemmap_alloc_block(unsigned long size, int node)
struct page *page;
if (node_state(node, N_HIGH_MEMORY))
- page = alloc_pages_node(node,
+ page = alloc_pages_exact_node(node,
GFP_KERNEL | __GFP_ZERO, get_order(size));
else
page = alloc_pages(GFP_KERNEL | __GFP_ZERO,
--
1.7.0.5
--
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>
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v2] change alloc function in __vmalloc_area_node
2010-04-14 14:58 ` Minchan Kim
@ 2010-04-14 14:58 ` Minchan Kim
-1 siblings, 0 replies; 14+ messages in thread
From: Minchan Kim @ 2010-04-14 14:58 UTC (permalink / raw)
To: Andrew Morton
Cc: Mel Gorman, KAMEZAWA Hiroyuki, Bob Liu, linux-kernel, linux-mm,
Minchan Kim, Nick Piggin
V2
* Add some reviewed-by
__vmalloc_area_node never pass -1 to alloc_pages_node.
It means node's validity check is unnecessary.
So we can use alloc_pages_exact_node instead of alloc_pages_node.
It could avoid comparison and branch as 6484eb3e2a81807722 tried.
Cc: Nick Piggin <npiggin@suse.de>
Reviewed-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
mm/vmalloc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index ae00746..7abf423 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1499,7 +1499,7 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
if (node < 0)
page = alloc_page(gfp_mask);
else
- page = alloc_pages_node(node, gfp_mask, 0);
+ page = alloc_pages_exact_node(node, gfp_mask, 0);
if (unlikely(!page)) {
/* Successfully allocated i pages, free them in __vunmap() */
--
1.7.0.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v2] change alloc function in __vmalloc_area_node
@ 2010-04-14 14:58 ` Minchan Kim
0 siblings, 0 replies; 14+ messages in thread
From: Minchan Kim @ 2010-04-14 14:58 UTC (permalink / raw)
To: Andrew Morton
Cc: Mel Gorman, KAMEZAWA Hiroyuki, Bob Liu, linux-kernel, linux-mm,
Minchan Kim, Nick Piggin
V2
* Add some reviewed-by
__vmalloc_area_node never pass -1 to alloc_pages_node.
It means node's validity check is unnecessary.
So we can use alloc_pages_exact_node instead of alloc_pages_node.
It could avoid comparison and branch as 6484eb3e2a81807722 tried.
Cc: Nick Piggin <npiggin@suse.de>
Reviewed-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
mm/vmalloc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index ae00746..7abf423 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1499,7 +1499,7 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
if (node < 0)
page = alloc_page(gfp_mask);
else
- page = alloc_pages_node(node, gfp_mask, 0);
+ page = alloc_pages_exact_node(node, gfp_mask, 0);
if (unlikely(!page)) {
/* Successfully allocated i pages, free them in __vunmap() */
--
1.7.0.5
--
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>
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v2] Add comment in alloc_pages_exact_node
2010-04-14 14:58 ` Minchan Kim
@ 2010-04-14 14:58 ` Minchan Kim
-1 siblings, 0 replies; 14+ messages in thread
From: Minchan Kim @ 2010-04-14 14:58 UTC (permalink / raw)
To: Andrew Morton
Cc: Mel Gorman, KAMEZAWA Hiroyuki, Bob Liu, linux-kernel, linux-mm,
Minchan Kim
V2
o modify comment by suggestion. (Thanks to Mel)
alloc_pages_exact_node naming makes some people misleading.
They considered it following as.
"This function will allocate pages from node which I wanted
exactly".
But it can allocate pages from fallback list if page allocator
can't find free page from node user wanted.
So let's comment this NOTE.
Actually I wanted to change naming with better.
ex) alloc_pages_explict_node.
But I changed my mind since the comment would be enough.
If anybody suggests better name, I will do with pleasure.
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
include/linux/gfp.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index b65f003..56b5fe6 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -288,6 +288,12 @@ static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask));
}
+/*
+ * Use this instead of alloc_pages_node when the caller knows
+ * exactly which node they need (as opposed to passing in -1
+ * for current). Fallback to other nodes will still occur
+ * unless __GFP_THISNODE is specified.
+ */
static inline struct page *alloc_pages_exact_node(int nid, gfp_t gfp_mask,
unsigned int order)
{
--
1.7.0.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v2] Add comment in alloc_pages_exact_node
@ 2010-04-14 14:58 ` Minchan Kim
0 siblings, 0 replies; 14+ messages in thread
From: Minchan Kim @ 2010-04-14 14:58 UTC (permalink / raw)
To: Andrew Morton
Cc: Mel Gorman, KAMEZAWA Hiroyuki, Bob Liu, linux-kernel, linux-mm,
Minchan Kim
V2
o modify comment by suggestion. (Thanks to Mel)
alloc_pages_exact_node naming makes some people misleading.
They considered it following as.
"This function will allocate pages from node which I wanted
exactly".
But it can allocate pages from fallback list if page allocator
can't find free page from node user wanted.
So let's comment this NOTE.
Actually I wanted to change naming with better.
ex) alloc_pages_explict_node.
But I changed my mind since the comment would be enough.
If anybody suggests better name, I will do with pleasure.
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
include/linux/gfp.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index b65f003..56b5fe6 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -288,6 +288,12 @@ static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask));
}
+/*
+ * Use this instead of alloc_pages_node when the caller knows
+ * exactly which node they need (as opposed to passing in -1
+ * for current). Fallback to other nodes will still occur
+ * unless __GFP_THISNODE is specified.
+ */
static inline struct page *alloc_pages_exact_node(int nid, gfp_t gfp_mask,
unsigned int order)
{
--
1.7.0.5
--
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>
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v2] change alloc function in alloc_slab_page
2010-04-14 14:58 ` Minchan Kim
@ 2010-04-14 17:50 ` Pekka Enberg
-1 siblings, 0 replies; 14+ messages in thread
From: Pekka Enberg @ 2010-04-14 17:50 UTC (permalink / raw)
To: Minchan Kim
Cc: Andrew Morton, Mel Gorman, KAMEZAWA Hiroyuki, Bob Liu,
linux-kernel, linux-mm, Christoph Lameter
Minchan Kim wrote:
> V2
> * change changelog
> * Add some reviewed-by
>
> alloc_slab_page always checks nid == -1, so alloc_page_node can't be
> called with -1.
> It means node's validity check in alloc_pages_node is unnecessary.
> So we can use alloc_pages_exact_node instead of alloc_pages_node.
> It could avoid comparison and branch as 6484eb3e2a81807722 tried.
>
> Cc: Pekka Enberg <penberg@cs.helsinki.fi>
> Cc: Christoph Lameter <cl@linux-foundation.org>
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Reviewed-by: Mel Gorman <mel@csn.ul.ie>
> ---
> mm/slub.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/mm/slub.c b/mm/slub.c
> index b364844..9984165 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -1084,7 +1084,7 @@ static inline struct page *alloc_slab_page(gfp_t flags, int node,
> if (node == -1)
> return alloc_pages(flags, order);
> else
> - return alloc_pages_node(node, flags, order);
> + return alloc_pages_exact_node(node, flags, order);
> }
>
> static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
Applied, thanks!
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] change alloc function in alloc_slab_page
@ 2010-04-14 17:50 ` Pekka Enberg
0 siblings, 0 replies; 14+ messages in thread
From: Pekka Enberg @ 2010-04-14 17:50 UTC (permalink / raw)
To: Minchan Kim
Cc: Andrew Morton, Mel Gorman, KAMEZAWA Hiroyuki, Bob Liu,
linux-kernel, linux-mm, Christoph Lameter
Minchan Kim wrote:
> V2
> * change changelog
> * Add some reviewed-by
>
> alloc_slab_page always checks nid == -1, so alloc_page_node can't be
> called with -1.
> It means node's validity check in alloc_pages_node is unnecessary.
> So we can use alloc_pages_exact_node instead of alloc_pages_node.
> It could avoid comparison and branch as 6484eb3e2a81807722 tried.
>
> Cc: Pekka Enberg <penberg@cs.helsinki.fi>
> Cc: Christoph Lameter <cl@linux-foundation.org>
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Reviewed-by: Mel Gorman <mel@csn.ul.ie>
> ---
> mm/slub.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/mm/slub.c b/mm/slub.c
> index b364844..9984165 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -1084,7 +1084,7 @@ static inline struct page *alloc_slab_page(gfp_t flags, int node,
> if (node == -1)
> return alloc_pages(flags, order);
> else
> - return alloc_pages_node(node, flags, order);
> + return alloc_pages_exact_node(node, flags, order);
> }
>
> static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
Applied, thanks!
--
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>
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2010-04-14 17:50 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-14 14:58 [PATCH v2] Remove node's validity check in alloc_pages Minchan Kim
2010-04-14 14:58 ` Minchan Kim
2010-04-14 14:58 ` [PATCH] change alloc function in pcpu_alloc_pages Minchan Kim
2010-04-14 14:58 ` Minchan Kim
2010-04-14 14:58 ` [PATCH v2] change alloc function in alloc_slab_page Minchan Kim
2010-04-14 14:58 ` Minchan Kim
2010-04-14 17:50 ` Pekka Enberg
2010-04-14 17:50 ` Pekka Enberg
2010-04-14 14:58 ` [PATCH v2] change alloc function in vmemmap_alloc_block Minchan Kim
2010-04-14 14:58 ` Minchan Kim
2010-04-14 14:58 ` [PATCH v2] change alloc function in __vmalloc_area_node Minchan Kim
2010-04-14 14:58 ` Minchan Kim
2010-04-14 14:58 ` [PATCH v2] Add comment in alloc_pages_exact_node Minchan Kim
2010-04-14 14:58 ` Minchan Kim
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.