lkml.org 
[lkml]   [2004]   [Apr]   [7]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 8 Apr 2004 13:09:23 +1000
FromDavid Gibson <>
SubjectRe: RFC: COW for hugepages
On Wed, Apr 07, 2004 at 07:01:26PM -0700, Andrew Morton wrote:
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> >
> > 
> > > Implementing this for ppc64 only is just wrong. Before you do this 
> > > I would suggest to factor out the common code in the various hugetlbpage
> > > implementations and then implement it in common code.
> > 
> > Have you actually looked at it and how huge pages are implemented
> > on the various architectures ?
> > 
> > Honestly, I don't think we have any common abstraction on things
> > like hugepte's etc... actually, archs aren't even required to use
> > PTEs at all.
> > 
> > I don't see how we can make that code arch-neutral, at least not
> > without a major redesign of the whole large pages mecanism.
> 
> I don't see much in the COW code which is ppc64-specific.  All the hardware
> needs to do is to provide a way to make the big pages readonly.  With a bit
> of an abstraction for the TLB manipulation in there it should be pretty
> straightforward.
> 
> Certainly worth the attempt, no?

Yes, you have a point.  However doing it in a cross-arch way will
require building more of a shared abstraction about hugepage pte
entries that exists currently.  And that will mean making significant
changes to all the archs to create that abstraction.  I don't know
enough about the other archs to be confident of debugging such
changes, but I'll see what I can do.

That should let the actual handle_mm_fault->hugepage_cow codepath be
shared.  However how the hugepage ptes fit in with the rest of the
pagetables varies from arch to arch - on ppc64 we're considering
putting hugepages into their own entirely separate pagetables, even -
so anything that actually walks the pagetables (like
copy_hugetlb_page_range()) will still have to be arch-specific.

-- 
David Gibson			| For every complex problem there is a
david AT gibson.dropbear.id.au	| solution which is simple, neat and
				| wrong.
http://www.ozlabs.org/people/dgibson
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:02    [from the cache]
©2003-2008