Re: hugetlb demand paging patch part [2/3]

'David Gibson'
2004-04-17T12:05:40Z

On Fri, Apr 16, 2004 at 02:05:13PM -0500, Ray Bryant wrote:
> David,
>
> Is there a big user demand for copy-on-write support for hugetlb pages?
> I can understand the rationale for making hugetlb pages behave more like
> user pages, and fixing the problem that hugetlb pages are shared across
> fork via MAP_SHARE semantics regardless of whether the user requests
> MAP_PRIVATE or not, but it just doesn't strike me as something that anyone
> who uses hugetlb pages would actually want.

My main interest in it is as a prerequisite for various methods of
"automatically" using hugepages for programs where it is difficult to
manually code them to use hugetlbfs. In particular, think HPC
monsters written in FORTRAN. e.g. automatically putting suitable
aligned anonymous mmap()s in hugepages under some circumstances (I
can't say I like that idea much), using an LD_PRELOAD to put
malloc()ated memory into hugepages, or using a hacked ELF loader to
put the BSS section (again, think FORTRAN) into hugepages (actually
easier and less ugly than it sounds).

In any of these cases having the memory have different semantics
(MAP_SHARED) to normal anonymous memory would clearly be a Bad Thing.

> Of course, YRMV (your requirements may vary). :-)
>
> 'David Gibson' wrote:
> >
> >Well, I'm attempting to understand the hugepage code across all the
> >archs, so that I can try to implement copy-on-write with a minimum of
> >arch specific gunk. Simplifying and consolidating the existing code
> >across archs would be a helpful first step, if possible.