From 97af13f8f24980732ceae123b12f3fe88a3d08ca Mon Sep 17 00:00:00 2001 From: Debian Science Maintainers Date: Fri, 12 Jul 2024 01:16:04 -0400 Subject: [PATCH] Adjust HUGE_PAGE_SIZE size for loongarch64 Last-Update: 2024-05-10 Gbp-Pq: Name 0100-onetbb-fix-testcases-failed-for-loongarch64.patch --- 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..cc92b89 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.30.2