Adjust HUGE_PAGE_SIZE size for loongarch64
authorDebian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Fri, 12 Jul 2024 05:16:04 +0000 (01:16 -0400)
committerMo Zhou <lumin@debian.org>
Fri, 12 Jul 2024 05:16:04 +0000 (01:16 -0400)
Last-Update: 2024-05-10

Gbp-Pq: Name 0100-onetbb-fix-testcases-failed-for-loongarch64.patch

src/tbbmalloc/tbbmalloc_internal.h
test/tbbmalloc/test_malloc_whitebox.cpp

index c81dc06003a70e446688cad6fd1cf21f044f2a60..94c4e98f25a1f118c5ab1378cbd2e873337b7f78 100644 (file)
@@ -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 *********/
 
index 0f37e9f4e21f392e288309780851a979b8520346..cc92b892c196493bbdae63e9d17296bef0a1876d 100644 (file)
@@ -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;