On 02.02.2007 [15:36:25 -0800], Nishanth Aravamudan wrote:
> commit 122c260924a811b57e6c686004964d4b020ed29d
> Author: Nishanth Aravamudan <[EMAIL PROTECTED]>
> Date:   Fri Feb 2 13:13:48 2007 -0800
> 
>     elflink: store extracopy information
> 
>     Add a few fields to the seg_info structure to store the starting address
>     and size of the extracopy area for use by the next patch to drop
>     pagecache pages. If the extra_vaddr field is NULL, then the pagecache
>     dropping code assumes this means there was no extracopy area. This
>     method uses the start address and size to represent the extracopy area.
> 
>     Signed-off-by: Nishanth Aravamudan <[EMAIL PROTECTED]>
> 
> ---
> 


Would help if this patch actually worked :)

You need the following fix-up to get it to work when extracopy is not
involved:

Signed-off-by: Nishanth Aravamudan <[EMAIL PROTECTED]>

diff --git a/elflink.c b/elflink.c
index 08180fd..012a743 100644
--- a/elflink.c
+++ b/elflink.c
@@ -279,6 +279,7 @@ static void parse_phdrs(Elf_Ehdr *ehdr)
                htlb_seg_table[htlb_num_segs].memsz = memsz;
                htlb_seg_table[htlb_num_segs].prot = prot;
                htlb_seg_table[htlb_num_segs].phdr = i;
+               htlb_seg_table[htlb_num_segs].extra_vaddr = NULL;
                htlb_num_segs++;
        }
 }
@@ -589,9 +590,12 @@ static int prepare_segment(struct seg_info *seg)
         * the size of the shared mapping.
         */
        get_extracopy(seg);
-       size = ALIGN((unsigned long)seg->extra_vaddr +
-                       seg->extrasz - (unsigned long)seg->vaddr,
-                       hpage_size);
+       if (seg->extra_vaddr) {
+               size = ALIGN((unsigned long)seg->extra_vaddr + seg->extrasz -
+                               (unsigned long)seg->vaddr, hpage_size);
+       } else {
+               size = ALIGN(seg->filesz, hpage_size);
+       }
 
        /* Prepare the hugetlbfs file */
 


-- 
Nishanth Aravamudan <[EMAIL PROTECTED]>
IBM Linux Technology Center

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Libhugetlbfs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to