On Thu, Nov 06, 2008 at 10:08:27AM -0600, Adam Litke wrote:
> 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.

Well, fair enough, but names matter.  A function called
get_huge_pages() should, well, get some hugepages.  Not get a buffer
that is backed by hugepages.

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

-------------------------------------------------------------------------
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

Reply via email to