[PATCH v2] Add comment in alloc_pages_exact_node

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Minchan Kim
Date: Wednesday, April 14, 2010 - 7:58 am

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

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v2] Remove node's validity check in alloc_pages, Minchan Kim, (Wed Apr 14, 7:58 am)
[PATCH] change alloc function in pcpu_alloc_pages, Minchan Kim, (Wed Apr 14, 7:58 am)
[PATCH v2] change alloc function in alloc_slab_page, Minchan Kim, (Wed Apr 14, 7:58 am)
[PATCH v2] Add comment in alloc_pages_exact_node, Minchan Kim, (Wed Apr 14, 7:58 am)
Re: [PATCH v2] change alloc function in alloc_slab_page, Pekka Enberg, (Wed Apr 14, 10:50 am)