Sync from SUSE:SLFO:Main libhugetlbfs revision a1dd43bc7759cef8ba8098d5b988e556
This commit is contained in:
parent
33daf0b3c4
commit
10118aafd6
4
_service
4
_service
@ -1,12 +1,12 @@
|
||||
<services>
|
||||
<service name="obs_scm" mode="localonly">
|
||||
<service name="obs_scm" mode="manual">
|
||||
<param name="url">https://github.com/libhugetlbfs/libhugetlbfs.git</param>
|
||||
<param name="scm">git</param>
|
||||
<param name="revision">HEAD</param>
|
||||
<param name="versionformat">@PARENT_TAG@.@TAG_OFFSET@.g%h</param>
|
||||
<param name="changesgenerate">enable</param>
|
||||
</service>
|
||||
<service name="set_version" mode="localonly"/>
|
||||
<service name="set_version" mode="manual"/>
|
||||
<service name="tar" mode="buildtime"/>
|
||||
<service name="recompress" mode="buildtime">
|
||||
<param name="file">*.tar</param>
|
||||
|
4
_servicedata
Normal file
4
_servicedata
Normal file
@ -0,0 +1,4 @@
|
||||
<servicedata>
|
||||
<service name="tar_scm">
|
||||
<param name="url">https://github.com/libhugetlbfs/libhugetlbfs.git</param>
|
||||
<param name="changesrevision">1322884fb0d55dc55f53563c1aa6328d118997e7</param></service></servicedata>
|
@ -1,7 +1,7 @@
|
||||
Index: tests/Makefile
|
||||
Index: tests/Makefile.in
|
||||
===================================================================
|
||||
--- a/tests/Makefile.orig
|
||||
+++ b/tests/Makefile
|
||||
--- a/tests/Makefile.in.orig
|
||||
+++ b/tests/Makefile.in
|
||||
@@ -48,7 +48,7 @@ ifeq ($(CUSTOM_LDSCRIPTS),yes)
|
||||
TESTS += $(LDSCRIPT_TESTS) $(HUGELINK_TESTS) $(HUGELINK_TESTS:%=xB.%) \
|
||||
$(HUGELINK_TESTS:%=xBDT.%) $(HUGELINK_RW_TESTS)
|
||||
|
@ -1,258 +0,0 @@
|
||||
From 959d74fd0fbbff310943096e15024a84e8f5cba4 Mon Sep 17 00:00:00 2001
|
||||
From: Matheus Castanho <msc@linux.ibm.com>
|
||||
Date: Thu, 12 Aug 2021 16:38:46 -0300
|
||||
Subject: [PATCH] Disable hugepage-backed malloc if __morecore is not available
|
||||
|
||||
Starting with glibc 2.32, __morecore hook has been marked as deprecated, and was
|
||||
completely removed on glibc 2.34, which causes an undefined symbol error during
|
||||
the build of libhugetlbfs.
|
||||
|
||||
Greater changes are needed in order to keep providing the same functionality
|
||||
with future versions of glibc (see issue #52). Meanwhile, we can disable
|
||||
hugepage-backed malloc setup if __morecore is not available so users can at
|
||||
least keep using the other features provided by the library. Related tests are
|
||||
also conditionally disabled, and will show as SKIPPED if __morecore is not
|
||||
available.
|
||||
|
||||
Tested on powerpc64le and x86_64 with glibc 2.34 and olders.
|
||||
|
||||
Signed-off-by: Matheus Castanho <msc@linux.ibm.com>
|
||||
---
|
||||
Makefile | 6 +++++
|
||||
morecore.c | 8 ++++++
|
||||
tests/run_tests.py | 67 +++++++++++++++++++++++++++++++++++++++-------
|
||||
3 files changed, 71 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 8b73523..35e53e7 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -192,6 +192,12 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
+# glibc 2.34 removed __morecore, so it may not be available with recent versions
|
||||
+HAS_MORECORE := $(shell /bin/echo -e '\#include <malloc.h>\nvoid * morecore_exists() { return &__morecore; }' | $(CC) -c -xc -o /dev/null - &> /dev/null && /bin/echo yes || /bin/echo no)
|
||||
+ifeq ($(HAS_MORECORE),yes)
|
||||
+CFLAGS += -DHAS_MORECORE
|
||||
+endif
|
||||
+
|
||||
HEADERDIR = $(PREFIX)/include
|
||||
LIBDIR32 = $(PREFIX)/$(LIB32)
|
||||
LIBDIR64 = $(PREFIX)/$(LIB64)
|
||||
diff --git a/morecore.c b/morecore.c
|
||||
index 6563bbd..405c566 100644
|
||||
--- a/morecore.c
|
||||
+++ b/morecore.c
|
||||
@@ -33,6 +33,13 @@
|
||||
|
||||
#include "libhugetlbfs_internal.h"
|
||||
|
||||
+#ifndef HAS_MORECORE
|
||||
+void hugetlbfs_setup_morecore(void)
|
||||
+{
|
||||
+ INFO("Not setting up morecore because it's not available (see issue #52).\n");
|
||||
+}
|
||||
+#else
|
||||
+
|
||||
static int heap_fd;
|
||||
|
||||
static void *heapbase;
|
||||
@@ -381,3 +388,4 @@ void hugetlbfs_setup_morecore(void)
|
||||
* to mmap() if we run out of hugepages. */
|
||||
mallopt(M_MMAP_MAX, 0);
|
||||
}
|
||||
+#endif /* HAS_MORECORE */
|
||||
diff --git a/tests/run_tests.py b/tests/run_tests.py
|
||||
index 018264d..871d04d 100755
|
||||
--- a/tests/run_tests.py
|
||||
+++ b/tests/run_tests.py
|
||||
@@ -60,7 +60,7 @@ def snapshot_pool_state():
|
||||
l.append((d, tuple(substate)))
|
||||
return tuple(l)
|
||||
|
||||
-def run_test_prog(bits, pagesize, cmd, **env):
|
||||
+def run_test_prog(bits, pagesize, cmd, output='stdout', **env):
|
||||
if paranoid_pool_check:
|
||||
beforepool = snapshot_pool_state()
|
||||
print("Pool state: %s" % str(beforepool))
|
||||
@@ -73,15 +73,17 @@ def run_test_prog(bits, pagesize, cmd, **env):
|
||||
% (bits, bits, local_env.get("LD_LIBRARY_PATH", ""))
|
||||
local_env["HUGETLB_DEFAULT_PAGE_SIZE"] = repr(pagesize)
|
||||
|
||||
+ popen_args = {'env' : local_env, output : subprocess.PIPE}
|
||||
+
|
||||
try:
|
||||
- p = subprocess.Popen(cmd, env=local_env, stdout=subprocess.PIPE)
|
||||
+ p = subprocess.Popen(cmd, **popen_args)
|
||||
rc = p.wait()
|
||||
except KeyboardInterrupt:
|
||||
# Abort and mark this a strange test result
|
||||
return (None, "")
|
||||
except OSError as e:
|
||||
return (-e.errno, "")
|
||||
- out = p.stdout.read().decode().strip()
|
||||
+ out = getattr(p, output).read().decode().strip()
|
||||
|
||||
if paranoid_pool_check:
|
||||
afterpool = snapshot_pool_state()
|
||||
@@ -309,6 +311,33 @@ def check_linkhuge_tests():
|
||||
okbits.add(bits)
|
||||
return okbits
|
||||
|
||||
+def check_morecore_disabled():
|
||||
+ """
|
||||
+ Check if support for morecore is available.
|
||||
+
|
||||
+ Newer glibc versions (>= 2.34) removed the __morecore malloc hook, so tests
|
||||
+ relying on that functionality will not work as expected, and should be
|
||||
+ disabled.
|
||||
+ """
|
||||
+ global morecore_disabled, wordsizes, pagesizes
|
||||
+
|
||||
+ # Quick and dirty way to get a word and page size. Which one doesn't really
|
||||
+ # matter in this case.
|
||||
+ for wsz in wordsizes:
|
||||
+ b = wsz
|
||||
+ break
|
||||
+ for psz in pagesizes:
|
||||
+ p = psz
|
||||
+ break
|
||||
+
|
||||
+ # Run an arbitrary program and check stderr for the "morecore disabled"
|
||||
+ # message
|
||||
+ (rc, out) = run_test_prog(b, p, "gethugepagesize", output='stderr',
|
||||
+ HUGETLB_MORECORE="yes",
|
||||
+ HUGETLB_VERBOSE="3")
|
||||
+
|
||||
+ morecore_disabled = "Not setting up morecore" in out
|
||||
+
|
||||
def print_cmd(pagesize, bits, cmd, env):
|
||||
if env:
|
||||
print(' '.join(['%s=%s' % (k, v) for k, v in env.items()]), end=" ")
|
||||
@@ -357,14 +386,17 @@ def skip_test(pagesize, bits, cmd, **env):
|
||||
print_cmd(pagesize, bits, cmd, env)
|
||||
print("SKIPPED")
|
||||
|
||||
-def do_test(cmd, bits=None, **env):
|
||||
+def do_test(cmd, bits=None, skip=False, **env):
|
||||
"""
|
||||
Run a test case, testing each page size and each indicated word size.
|
||||
"""
|
||||
if bits == None: bits = wordsizes
|
||||
for p in pagesizes:
|
||||
for b in (set(bits) & wordsizes_by_pagesize[p]):
|
||||
- run_test(p, b, cmd, **env)
|
||||
+ if skip:
|
||||
+ skip_test(p, b, cmd, **env)
|
||||
+ else:
|
||||
+ run_test(p, b, cmd, **env)
|
||||
|
||||
def do_test_with_rlimit(rtype, limit, cmd, bits=None, **env):
|
||||
"""
|
||||
@@ -375,7 +407,7 @@ def do_test_with_rlimit(rtype, limit, cmd, bits=None, **env):
|
||||
do_test(cmd, bits, **env)
|
||||
resource.setrlimit(rtype, oldlimit)
|
||||
|
||||
-def do_test_with_pagesize(pagesize, cmd, bits=None, **env):
|
||||
+def do_test_with_pagesize(pagesize, cmd, bits=None, skip=False, **env):
|
||||
"""
|
||||
Run a test case, testing with a specified huge page size and
|
||||
each indicated word size.
|
||||
@@ -383,7 +415,10 @@ def do_test_with_pagesize(pagesize, cmd, bits=None, **env):
|
||||
if bits == None:
|
||||
bits = wordsizes
|
||||
for b in (set(bits) & wordsizes_by_pagesize[pagesize]):
|
||||
- run_test(pagesize, b, cmd, **env)
|
||||
+ if skip:
|
||||
+ skip_test(pagesize, b, cmd, **env)
|
||||
+ else:
|
||||
+ run_test(pagesize, b, cmd, **env)
|
||||
|
||||
def do_elflink_test(cmd, **env):
|
||||
"""
|
||||
@@ -533,7 +568,7 @@ def functional_tests():
|
||||
"""
|
||||
Run the set of functional tests.
|
||||
"""
|
||||
- global linkhuge_wordsizes
|
||||
+ global linkhuge_wordsizes, morecore_disabled
|
||||
|
||||
# Kernel background tests not requiring hugepage support
|
||||
do_test("zero_filesize_segment")
|
||||
@@ -598,19 +633,24 @@ def functional_tests():
|
||||
do_test("fork-cow")
|
||||
do_test("direct")
|
||||
do_test_with_pagesize(system_default_hpage_size, "malloc")
|
||||
+
|
||||
do_test_with_pagesize(system_default_hpage_size, "malloc",
|
||||
+ skip=morecore_disabled,
|
||||
LD_PRELOAD="libhugetlbfs.so",
|
||||
HUGETLB_MORECORE="yes")
|
||||
do_test_with_pagesize(system_default_hpage_size, "malloc",
|
||||
+ skip=morecore_disabled,
|
||||
LD_PRELOAD="libhugetlbfs.so",
|
||||
HUGETLB_MORECORE="yes",
|
||||
HUGETLB_RESTRICT_EXE="unknown:none")
|
||||
do_test_with_pagesize(system_default_hpage_size, "malloc",
|
||||
+ skip=morecore_disabled,
|
||||
LD_PRELOAD="libhugetlbfs.so",
|
||||
HUGETLB_MORECORE="yes",
|
||||
HUGETLB_RESTRICT_EXE="unknown:malloc")
|
||||
do_test_with_pagesize(system_default_hpage_size, "malloc_manysmall")
|
||||
do_test_with_pagesize(system_default_hpage_size, "malloc_manysmall",
|
||||
+ skip=morecore_disabled,
|
||||
LD_PRELOAD="libhugetlbfs.so",
|
||||
HUGETLB_MORECORE="yes")
|
||||
|
||||
@@ -630,26 +670,32 @@ def functional_tests():
|
||||
do_test_with_pagesize(system_default_hpage_size, "heapshrink",
|
||||
GLIBC_TUNABLES="glibc.malloc.tcache_count=0",
|
||||
LD_PRELOAD="libheapshrink.so")
|
||||
+
|
||||
do_test_with_pagesize(system_default_hpage_size, "heapshrink",
|
||||
+ skip=morecore_disabled,
|
||||
GLIBC_TUNABLES="glibc.malloc.tcache_count=0",
|
||||
LD_PRELOAD="libhugetlbfs.so",
|
||||
HUGETLB_MORECORE="yes")
|
||||
do_test_with_pagesize(system_default_hpage_size, "heapshrink",
|
||||
+ skip=morecore_disabled,
|
||||
GLIBC_TUNABLES="glibc.malloc.tcache_count=0",
|
||||
LD_PRELOAD="libhugetlbfs.so libheapshrink.so",
|
||||
HUGETLB_MORECORE="yes")
|
||||
do_test_with_pagesize(system_default_hpage_size, "heapshrink",
|
||||
+ skip=morecore_disabled,
|
||||
GLIBC_TUNABLES="glibc.malloc.tcache_count=0",
|
||||
LD_PRELOAD="libheapshrink.so",
|
||||
HUGETLB_MORECORE="yes",
|
||||
HUGETLB_MORECORE_SHRINK="yes")
|
||||
do_test_with_pagesize(system_default_hpage_size, "heapshrink",
|
||||
+ skip=morecore_disabled,
|
||||
GLIBC_TUNABLES="glibc.malloc.tcache_count=0",
|
||||
LD_PRELOAD="libhugetlbfs.so libheapshrink.so",
|
||||
HUGETLB_MORECORE="yes",
|
||||
HUGETLB_MORECORE_SHRINK="yes")
|
||||
|
||||
- do_test("heap-overflow", HUGETLB_VERBOSE="1", HUGETLB_MORECORE="yes")
|
||||
+ do_test("heap-overflow", skip=morecore_disabled, HUGETLB_VERBOSE="1",
|
||||
+ HUGETLB_MORECORE="yes")
|
||||
|
||||
# Run the remapping tests' up-front checks
|
||||
linkhuge_wordsizes = check_linkhuge_tests()
|
||||
@@ -747,7 +793,7 @@ def print_help():
|
||||
|
||||
def main():
|
||||
global wordsizes, pagesizes, dangerous, paranoid_pool_check, system_default_hpage_size
|
||||
- global custom_ldscripts
|
||||
+ global custom_ldscripts, morecore_disabled
|
||||
testsets = set()
|
||||
env_override = {"QUIET_TEST": "1", "HUGETLBFS_MOUNTS": "",
|
||||
"HUGETLB_ELFMAP": None, "HUGETLB_MORECORE": None}
|
||||
@@ -802,6 +848,7 @@ def main():
|
||||
return 1
|
||||
|
||||
check_hugetlbfs_path()
|
||||
+ check_morecore_disabled()
|
||||
|
||||
if "func" in testsets: functional_tests()
|
||||
if "stress" in testsets: stress_tests()
|
BIN
libhugetlbfs-2.23.0.g6b126a4.obscpio
(Stored with Git LFS)
BIN
libhugetlbfs-2.23.0.g6b126a4.obscpio
(Stored with Git LFS)
Binary file not shown.
BIN
libhugetlbfs-2.24.0.g1322884.obscpio
(Stored with Git LFS)
Normal file
BIN
libhugetlbfs-2.24.0.g1322884.obscpio
(Stored with Git LFS)
Normal file
Binary file not shown.
11
libhugetlbfs-increase-mount-buffer.patch
Normal file
11
libhugetlbfs-increase-mount-buffer.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- a/hugeutils.c
|
||||
+++ b/hugeutils.c
|
||||
@@ -617,7 +617,7 @@
|
||||
hpage_sizes[i].mount);
|
||||
}
|
||||
|
||||
-#define LINE_MAXLEN 2048
|
||||
+#define LINE_MAXLEN 4096
|
||||
static void find_mounts(void)
|
||||
{
|
||||
int fd;
|
@ -1,3 +1,31 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 11 09:47:47 UTC 2024 - trenn@suse.de
|
||||
|
||||
- Adopt to mainline:
|
||||
M libhugetlbfs_ia64_fix_missing_test.patch
|
||||
M disable-rw-on-non-ldscripts.diff
|
||||
M zero_filesize_segment.patch
|
||||
D glibc-2.34-fix.patch
|
||||
- Update to version 2.24.0.g1322884:
|
||||
* Update NEWS for 2.24 release
|
||||
* CI: Add build, codeql, codestyle check
|
||||
* build: automake support
|
||||
* test: disable partial usecases of shmoverride_linked_static
|
||||
* elflink.c: Fix LOAD max segment to adapt x86
|
||||
* Add support for loong64
|
||||
* alloc.c: Fix get_hugepage_region might return a wild pointer
|
||||
* run_tests: Fix bug in paranoid bug
|
||||
* Add closing the fd when exiting from gethugepagesizes
|
||||
* tests: Append CPPFLAGS rather then override
|
||||
* Update hugetlbfs.h
|
||||
* Disable hugepage-backed malloc if __morecore is not available
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Nov 1 16:44:03 UTC 2023 - Thomas Abraham <tabraham@suse.com>
|
||||
|
||||
- Add libhugetlbfs-increase-mount-buffer.patch for upstream issue gh#43
|
||||
(boo#1216576)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 1 03:18:42 UTC 2023 - Bernhard Wiedemann <bwiedemann@suse.com>
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
name: libhugetlbfs
|
||||
version: 2.23.0.g6b126a4
|
||||
mtime: 1599498497
|
||||
commit: 6b126a4d7da9490fa40fe7e1b962edcb939feddc
|
||||
version: 2.24.0.g1322884
|
||||
mtime: 1710145296
|
||||
commit: 1322884fb0d55dc55f53563c1aa6328d118997e7
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package libhugetlbfs
|
||||
#
|
||||
# Copyright (c) 2021 SUSE LLC
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
%define my_make_flags V=1 CFLAGS="%{optflags} -fPIC" LDFLAGS="-pie" BUILDTYPE=NATIVEONLY PREFIX=%{_prefix} LIBDIR32=%{_libdir} DESTDIR=%{buildroot}
|
||||
Name: libhugetlbfs
|
||||
Version: 2.23.0.g6b126a4
|
||||
Version: 2.24.0.g1322884
|
||||
Release: 0
|
||||
Summary: Helper library for the Huge Translation Lookaside Buffer Filesystem
|
||||
License: LGPL-2.1-or-later
|
||||
@ -30,10 +30,11 @@ Patch0: libhugetlbfs.tests-malloc.patch
|
||||
Patch1: libhugetlbfs_ia64_fix_missing_test.patch
|
||||
Patch2: disable-rw-on-non-ldscripts.diff
|
||||
Patch3: zero_filesize_segment.patch
|
||||
Patch4: glibc-2.34-fix.patch
|
||||
Patch4: libhugetlbfs-increase-mount-buffer.patch
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: doxygen
|
||||
BuildRequires: glibc-devel-static
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
# bug437293
|
||||
%ifarch ppc64
|
||||
Obsoletes: libhugetlbfs-64bit
|
||||
@ -64,13 +65,15 @@ The testsuite for libhugetlbfs. Binaries can be found in
|
||||
|
||||
%build
|
||||
echo %{version} > version
|
||||
./autogen.sh
|
||||
%{configure}
|
||||
make %{my_make_flags}
|
||||
|
||||
%install
|
||||
make %{my_make_flags} PMDIR="%{perl_vendorlib}/TLBC" \
|
||||
install install-tests
|
||||
mkdir -p %{buildroot}%{_prefix}/include
|
||||
cp -avL hugetlbfs.h %{buildroot}%{_prefix}/include
|
||||
mkdir -p %{buildroot}%{_includedir}
|
||||
cp -avL hugetlbfs.h %{buildroot}%{_includedir}
|
||||
chmod 644 %{buildroot}%{_libdir}/*.a
|
||||
if [ -f %{buildroot}%{_libdir}/libhugetlbfs/tests/obj64/dummy.ldscript ]; then
|
||||
chmod -f a-x %{buildroot}%{_libdir}/libhugetlbfs/tests/obj64/dummy.ldscript
|
||||
|
@ -7,13 +7,13 @@ same seem to be the case for x86_64 in version 2.15.
|
||||
Signed-off-by: Thomas Renninger <trenn@suse.de>
|
||||
|
||||
---
|
||||
tests/Makefile | 2 +-
|
||||
tests/Makefile.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Index: libhugetlbfs-2.21/tests/Makefile
|
||||
Index: libhugetlbfs-2.21/tests/Makefile.in
|
||||
===================================================================
|
||||
--- libhugetlbfs-2.21.orig/tests/Makefile
|
||||
+++ libhugetlbfs-2.21/tests/Makefile
|
||||
--- libhugetlbfs-2.21.orig/tests/Makefile.in
|
||||
+++ libhugetlbfs-2.21/tests/Makefile.in
|
||||
@@ -295,7 +295,7 @@ obj64/install:
|
||||
$(INSTALL) -m 755 wrapper-utils.sh $(DESTDIR)$(INST_TESTSDIR64)/obj64
|
||||
$(INSTALL) -m 755 $(HELPERS:%=obj64/%) $(DESTDIR)$(INST_TESTSDIR64)/obj64
|
||||
|
@ -1,7 +1,7 @@
|
||||
diff --git a/tests/Makefile b/tests/Makefile
|
||||
diff --git a/tests/Makefile.in b/tests/Makefile.in
|
||||
index e2e1156..4daa5d1 100644
|
||||
--- a/tests/Makefile
|
||||
+++ b/tests/Makefile
|
||||
--- a/tests/Makefile.in
|
||||
+++ b/tests/Makefile.in
|
||||
@@ -39,6 +39,11 @@ LDLIBS = $(STATIC_LDLIBS) -ldl -lhugetlbfs_privutils
|
||||
LDFLAGS32 = -L../obj32
|
||||
LDFLAGS64 = -L../obj64
|
||||
|
Loading…
Reference in New Issue
Block a user