RE: [Lhms-devel] [PATCH 0/7] Fragmentation Avoidance V19

Rohit Seth
2005-11-07T20:51:01Z

On Mon, 2005-11-07 at 12:58 -0600, Adam Litke wrote:

> I am currently working on an new approach to what you tried. It
> requires fewer changes to the kernel and implements the special large
> page usage entirely in an LD_PRELOAD library. And on newer kernels,
> programs linked with the .x ldscript you mention above can run using all
> small pages if not enough large pages are available.
>

Isn't it true that most of the times we'll need to be worrying about
run-time allocation of memory (using malloc or such) as compared to
static.

> For the curious, here's how this all works:
> 1) Link the unmodified application source with a custom linker script which
> does the following:
> - Align elf segments to large page boundaries
> - Assert a non-standard Elf program header flag (PF_LINUX_HTLB)
> to signal something (see below) to use large pages.

We'll need a similar flag for even code pages to start using hugetlb
pages. In this case to keep the kernel changes to minimum, RTLD will
need to modified.

> 2) Boot a kernel that supports copy-on-write for PRIVATE hugetlb pages
> 3) Use an LD_PRELOAD library which reloads the PF_LINUX_HTLB segments into
> large pages and transfers control back to the application.
>

COW, swap etc. are all very nice (little!) features that make hugetlb to
get used more transparently.

-rohit