diff --git a/LoongArch64-use-32-HUGE_PAGE_SIZE.patch b/LoongArch64-use-32-HUGE_PAGE_SIZE.patch new file mode 100644 index 0000000000000000000000000000000000000000..88676ab55d2e3e3c51a3a02b286839ab91be03c3 --- /dev/null +++ b/LoongArch64-use-32-HUGE_PAGE_SIZE.patch @@ -0,0 +1,45 @@ +From 78d0318fc27026c79986a82f0c763e11e67670ca Mon Sep 17 00:00:00 2001 +From: JiaLing Zhang +Date: Wed, 19 Feb 2025 09:49:55 +0800 +Subject: [PATCH] LoongArch64 use 32 HUGE_PAGE_SIZE + +--- + src/tbbmalloc/tbbmalloc_internal.h | 4 ++++ + test/tbbmalloc/test_malloc_whitebox.cpp | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/src/tbbmalloc/tbbmalloc_internal.h b/src/tbbmalloc/tbbmalloc_internal.h +index c81dc06..94c4e98 100644 +--- a/src/tbbmalloc/tbbmalloc_internal.h ++++ b/src/tbbmalloc/tbbmalloc_internal.h +@@ -102,7 +102,11 @@ void suppress_unused_warning( const T& ) {} + /* + * Default huge page size + */ ++#if defined __loongarch64 ++static const size_t HUGE_PAGE_SIZE = 32 * 1024 * 1024; ++#else + static const size_t HUGE_PAGE_SIZE = 2 * 1024 * 1024; ++#endif + + /********** End of global default constants *********/ + +diff --git a/test/tbbmalloc/test_malloc_whitebox.cpp b/test/tbbmalloc/test_malloc_whitebox.cpp +index 0f37e9f..5e1547d 100644 +--- a/test/tbbmalloc/test_malloc_whitebox.cpp ++++ b/test/tbbmalloc/test_malloc_whitebox.cpp +@@ -1257,7 +1257,11 @@ void TestTHP() { + scalable_allocation_mode(USE_HUGE_PAGES, 1); + REQUIRE_MESSAGE(hugePages.isEnabled, "Huge pages should be enabled via scalable_allocation_mode"); + ++ #if defined __loongarch64 ++ const int HUGE_PAGE_SIZE = 32 * 1024 * 1024; ++ #else + const int HUGE_PAGE_SIZE = 2 * 1024 * 1024; ++ #endif + + // allocCount transparent huge pages should be allocated + const int allocCount = 10; +-- +2.43.0 + diff --git a/tbb.spec b/tbb.spec index 94a90e855da0743a15835113b72590f208f06ced..47a1c597bd75534b5a0934267f0c1e531826df53 100644 --- a/tbb.spec +++ b/tbb.spec @@ -1,6 +1,6 @@ Name: tbb Version: 2021.11.0 -Release: 4 +Release: 5 Summary: Threading Building Blocks lets you easily write parallel C++ programs License: Apache-2.0 URL: http://threadingbuildingblocks.org/ @@ -13,6 +13,7 @@ Patch1: tbb-2021-strict-aliasing.patch Patch6001: backport-tbb-sphinx-8.patch Patch9000: bugfix-tbb-fix-__TBB_machine_fetchadd4-was-not-declared-on-.patch +Patch9001: LoongArch64-use-32-HUGE_PAGE_SIZE.patch BuildRequires: gcc-c++ swig python3-devel hwloc hwloc-devel cmake python3-pip BuildRequires: python3-setuptools python3-sphinx python3-sphinx_rtd_theme python3-wheel @@ -145,6 +146,9 @@ rm -fr %{buildroot}%{_datadir}/doc %{python3_sitearch}/__pycache__/TBB* %changelog +* Tue Apr 29 2025 zhangzikang - 2021.11.0-5 +- LoongArch64 use 32 HUGE_PAGE_SIZE + * Fri Jan 24 2025 Funda Wang - 2021.11.0-4 - fix build with new cmake macro