Thread (43 messages) 43 messages, 7 authors, 2012-06-16

Re: [PATCH -V6 03/14] hugetlbfs: Add an inline helper for finding hstate index

From: Aneesh Kumar K.V <hidden>
Date: 2012-05-27 20:08:34
Also in: linux-mm, lkml
Subsystem: hugetlb subsystem, memory management, the rest · Maintainers: Muchun Song, Oscar Salvador, Andrew Morton, Linus Torvalds

On Thu, May 24, 2012 at 02:22:27PM -0700, David Rientjes wrote:
On Mon, 16 Apr 2012, Aneesh Kumar K.V wrote:
quoted
From: "Aneesh Kumar K.V" <redacted>

Add an inline helper and use it in the code.

Acked-by: Michal Hocko <redacted>
Reviewed-by: KAMEZAWA Hiroyuki <redacted>
Signed-off-by: Aneesh Kumar K.V <redacted>
I like the helper function, but you missed using it in 
hugetlb_init().
Will do this as an add on patc on top
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 4b90dd5..58eead5 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1891,7 +1891,7 @@ static int __init hugetlb_init(void)
 		if (!size_to_hstate(default_hstate_size))
 			hugetlb_add_hstate(HUGETLB_PAGE_ORDER);
 	}
-	default_hstate_idx = size_to_hstate(default_hstate_size) - hstates;
+	default_hstate_idx = hstate_index(size_to_hstate(default_hstate_size));
 	if (default_hstate_max_huge_pages)
 		default_hstate.max_huge_pages = default_hstate_max_huge_pages;
 

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help