On Thu, 2008-11-06 at 10:15 +1100, David Gibson wrote: > On Wed, Nov 05, 2008 at 09:43:40AM -0600, Adam Litke wrote: > > On Wed, 2008-11-05 at 14:02 +0000, Mel Gorman wrote: > > > @@ -127,6 +140,34 @@ void *get_huge_pages(size_t len, ghp_t flags) > > > return NULL; > > > } > > > > > > +offset: > > > > This cache-coloring code (below) is nice. Could we move it into it's > > own function though? I like the idea of caching the sysconf value, but > > perhaps you could do that as a static variable within the new > > function. > > Yeah, I don't think this belongs in get_huge_pages(). > get_huge_pages() is supposed to be the "raw" low-level interface to > just grab some hugepages. Offsetting within the page should be up to > the caller, if it cares.
So the dispute is on how "smart" get_huge_pages() should be. I will agree that the name 'get_huge_pages' was perhaps a bad choice. While the name suggests a raw interface, it doesn't make sense to limit it to that because we already have two levels of raw interfaces. The maverick coder can choose to open() and mmap() files directly from any hugetlbfs they know about. Slightly more guidance is offered by the get_unlinked_fd() raw interface. Then we move up to get_huge_pages(). My understanding was that this interface was meant to remove all intermediate steps that have been necessary to access huge page memory: one call, one buffer, ready to use. A buffer with potential cache-coloring performance issues is not ready to use in my view. -- Adam Litke - (agl at us.ibm.com) IBM Linux Technology Center ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Libhugetlbfs-devel mailing list Libhugetlbfs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel