How to prevent "Segments would overlap"

117 views
Skip to first unread message

Joshua Chia

unread,
Dec 25, 2020, 12:56:38 AM12/25/20
to libhugetlbfs
On x86-64, I'm trying to remap segments onto 1G pages. Is it possible? I'm getting the following problem on CentOS 8 when I try.

13:33 $ g++ -O3 -B/usr/share/libhugetlbfs -Wl,--hugetlbfs-align -lhugetlbfs test.cpp
13:34 $ hugeedit a.out
Segment 2 0x400000 - 0x400cd8 (TEXT) default is BASE pages
Segment 3 0xbffdb8 - 0xc00198 (DATA) default is BASE pages
13:34 $ HUGETLB_VERBOSE=5 HUGETLB_ELFMAP='R=1G:W=1G' ./a.out
libhugetlbfs [angler:25092]: INFO: Found pagesize 2048 kB
libhugetlbfs [angler:25092]: INFO: Parsed kernel version: [4] . [18] . [0] 
libhugetlbfs [angler:25092]: INFO: Feature private_reservations is present in this kernel
libhugetlbfs [angler:25092]: INFO: Feature noreserve_safe is present in this kernel
libhugetlbfs [angler:25092]: INFO: Feature map_hugetlb is present in this kernel
libhugetlbfs [angler:25092]: INFO: Kernel has MAP_PRIVATE reservations.  Disabling heap prefaulting.
libhugetlbfs [angler:25092]: INFO: Kernel supports MAP_HUGETLB
libhugetlbfs [angler:25092]: INFO: HUGETLB_SHARE=0, sharing disabled
libhugetlbfs [angler:25092]: INFO: HUGETLB_NO_RESERVE=no, reservations enabled
libhugetlbfs [angler:25092]: INFO: Segment 0 (phdr 2): 0x400000-0x400cd8  (filesz=0xcd8) (prot = 0x5)
libhugetlbfs [angler:25092]: INFO: Segment 1 (phdr 3): 0xbffdb8-0xc00198  (filesz=0x2ac) (prot = 0x3)
libhugetlbfs [angler:25092]: WARNING: Layout problem with segments 0 and 1:
Segments would overlap
libhugetlbfs [angler:25092]: INFO: No segments were appropriate for remapping
0x11edeb0 0x11eeec0 2023088 2027200
^C
13:34 $ HUGETLB_VERBOSE=5 HUGETLB_ELFMAP='R=2M:W=2M' ./a.out
libhugetlbfs [angler:25097]: INFO: Found pagesize 2048 kB
libhugetlbfs [angler:25097]: INFO: Parsed kernel version: [4] . [18] . [0] 
libhugetlbfs [angler:25097]: INFO: Feature private_reservations is present in this kernel
libhugetlbfs [angler:25097]: INFO: Feature noreserve_safe is present in this kernel
libhugetlbfs [angler:25097]: INFO: Feature map_hugetlb is present in this kernel
libhugetlbfs [angler:25097]: INFO: Kernel has MAP_PRIVATE reservations.  Disabling heap prefaulting.
libhugetlbfs [angler:25097]: INFO: Kernel supports MAP_HUGETLB
libhugetlbfs [angler:25097]: INFO: HUGETLB_SHARE=0, sharing disabled
libhugetlbfs [angler:25097]: INFO: HUGETLB_NO_RESERVE=no, reservations enabled
libhugetlbfs [angler:25097]: INFO: Segment 0 (phdr 2): 0x400000-0x400cd8  (filesz=0xcd8) (prot = 0x5)
libhugetlbfs [angler:25097]: INFO: Segment 1 (phdr 3): 0xbffdb8-0xc00198  (filesz=0x2ac) (prot = 0x3)
libhugetlbfs [angler:25097]: INFO: libhugetlbfs version: 2.21 (modified)
libhugetlbfs [angler:25098]: INFO: Mapped hugeseg at 0x7f92b0c00000. Copying 0xcd8 bytes and 0 extra bytes from 0x400000...done
libhugetlbfs [angler:25097]: INFO: Prepare succeeded
libhugetlbfs [angler:25099]: INFO: Mapped hugeseg at 0x7f92b0a00000. Copying 0x2ac bytes and 0x12c extra bytes from 0xbffdb8...done
libhugetlbfs [angler:25097]: INFO: Prepare succeeded
0x1420eb0 0x1421ec0 134832 138944
^C
Reply all
Reply to author
Forward
0 new messages