[lkml]   [2004]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: RFC: COW for hugepages
On Wed, Apr 07, 2004 at 07:01:26PM -0700, Andrew Morton wrote:
> Benjamin Herrenschmidt <> 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 | solution which is simple, neat and
| wrong.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:02    [W:0.040 / U:44.088 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site