Skip to content

Commit 51b78a4

Browse files
committed
Add the jemalloc_coarse_devdax and scalable_coarse_devdax tests
Add the jemalloc_coarse_devdax and scalable_coarse_devdax tests that test the coarse provider with upstream devdax provider and two pool managers: jemalloc and scalable pool. Signed-off-by: Lukasz Dorau <[email protected]>
1 parent a76cf02 commit 51b78a4

9 files changed

+246
-0
lines changed

test/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,20 @@ if(LINUX AND (NOT UMF_DISABLE_HWLOC)) # OS-specific functions are implemented
263263
NAME jemalloc_coarse_file
264264
SRCS pools/jemalloc_coarse_file.cpp malloc_compliance_tests.cpp
265265
LIBS jemalloc_pool)
266+
add_umf_test(
267+
NAME jemalloc_coarse_devdax
268+
SRCS pools/jemalloc_coarse_devdax.cpp malloc_compliance_tests.cpp
269+
LIBS jemalloc_pool)
266270
endif()
267271

268272
# This test requires Linux-only file memory provider
269273
if(UMF_POOL_SCALABLE_ENABLED)
270274
add_umf_test(
271275
NAME scalable_coarse_file SRCS pools/scalable_coarse_file.cpp
272276
malloc_compliance_tests.cpp)
277+
add_umf_test(
278+
NAME scalable_coarse_devdax SRCS pools/scalable_coarse_devdax.cpp
279+
malloc_compliance_tests.cpp)
273280
endif()
274281

275282
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND UMF_BUILD_FUZZTESTS)

test/poolFixtures.hpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "pool.hpp"
99
#include "provider.hpp"
1010
#include "umf/providers/provider_coarse.h"
11+
#include "umf/providers/provider_devdax_memory.h"
1112

1213
#include <array>
1314
#include <cstring>
@@ -66,6 +67,23 @@ struct umfPoolTest : umf_test::test,
6667
::testing::WithParamInterface<poolCreateExtParams> {
6768
void SetUp() override {
6869
test::SetUp();
70+
71+
auto [pool_ops, pool_params, provider_ops, provider_params,
72+
coarse_params] = this->GetParam();
73+
if (provider_ops == umfDevDaxMemoryProviderOps()) {
74+
char *path = getenv("UMF_TESTS_DEVDAX_PATH");
75+
if (path == nullptr || path[0] == 0) {
76+
GTEST_SKIP()
77+
<< "Test skipped, UMF_TESTS_DEVDAX_PATH is not set";
78+
}
79+
80+
char *size = getenv("UMF_TESTS_DEVDAX_SIZE");
81+
if (size == nullptr || size[0] == 0) {
82+
GTEST_SKIP()
83+
<< "Test skipped, UMF_TESTS_DEVDAX_SIZE is not set";
84+
}
85+
}
86+
6987
pool = poolCreateExtUnique(this->GetParam());
7088
}
7189

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright (C) 2024 Intel Corporation
2+
// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
3+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
5+
#include "umf/pools/pool_jemalloc.h"
6+
7+
#include "pool_coarse_devdax.hpp"
8+
9+
auto coarseParams = umfCoarseMemoryProviderParamsDefault();
10+
auto devdaxParams = umfDevDaxMemoryProviderParamsDefault(
11+
getenv("UMF_TESTS_DEVDAX_PATH"), getenv("UMF_TESTS_DEVDAX_SIZE")
12+
? atol(getenv("UMF_TESTS_DEVDAX_SIZE"))
13+
: 0);
14+
15+
INSTANTIATE_TEST_SUITE_P(jemallocCoarseDevDaxTest, umfPoolTest,
16+
::testing::Values(poolCreateExtParams{
17+
umfJemallocPoolOps(), nullptr,
18+
umfDevDaxMemoryProviderOps(), &devdaxParams,
19+
&coarseParams}));

test/pools/pool_coarse_devdax.hpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright (C) 2024 Intel Corporation
2+
// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
3+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
5+
#ifndef UMF_TEST_POOL_COARSE_FILE_HPP
6+
#define UMF_TEST_POOL_COARSE_FILE_HPP 1
7+
8+
#include "umf/providers/provider_coarse.h"
9+
#include "umf/providers/provider_devdax_memory.h"
10+
11+
#include "pool.hpp"
12+
#include "poolFixtures.hpp"
13+
14+
using umf_test::test;
15+
using namespace umf_test;
16+
17+
#endif /* UMF_TEST_POOL_COARSE_FILE_HPP */
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright (C) 2024 Intel Corporation
2+
// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
3+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
5+
#include "umf/pools/pool_scalable.h"
6+
7+
#include "pool_coarse_devdax.hpp"
8+
9+
auto coarseParams = umfCoarseMemoryProviderParamsDefault();
10+
auto devdaxParams = umfDevDaxMemoryProviderParamsDefault(
11+
getenv("UMF_TESTS_DEVDAX_PATH"), getenv("UMF_TESTS_DEVDAX_SIZE")
12+
? atol(getenv("UMF_TESTS_DEVDAX_SIZE"))
13+
: 0);
14+
15+
INSTANTIATE_TEST_SUITE_P(scalableCoarseDevDaxTest, umfPoolTest,
16+
::testing::Values(poolCreateExtParams{
17+
umfScalablePoolOps(), nullptr,
18+
umfDevDaxMemoryProviderOps(), &devdaxParams,
19+
&coarseParams}));
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
False-positive ConflictingAccess in libjemalloc.so
3+
drd:ConflictingAccess
4+
obj:*/libjemalloc.so*
5+
...
6+
fun:mallocx
7+
...
8+
}
9+
10+
{
11+
False-positive ConflictingAccess in libjemalloc.so
12+
drd:ConflictingAccess
13+
obj:*/libjemalloc.so*
14+
...
15+
fun:op_free
16+
...
17+
}
18+
19+
{
20+
False-positive ConflictingAccess in libjemalloc.so
21+
drd:ConflictingAccess
22+
obj:*/libjemalloc.so*
23+
...
24+
fun:__nptl_deallocate_tsd
25+
...
26+
}
27+
28+
{
29+
False-positive ConflictingAccess in critnib_insert
30+
drd:ConflictingAccess
31+
fun:store
32+
fun:critnib_insert
33+
...
34+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
False-positive ConflictingAccess in libtbbmalloc.so
3+
drd:ConflictingAccess
4+
obj:*/libtbbmalloc.so*
5+
}
6+
7+
{
8+
False-positive ConflictingAccess in libtbbmalloc.so
9+
drd:ConflictingAccess
10+
obj:*/libtbbmalloc.so*
11+
...
12+
fun:tbb_malloc
13+
...
14+
}
15+
16+
{
17+
False-positive ConflictingAccess in libtbbmalloc.so
18+
drd:ConflictingAccess
19+
obj:*/libtbbmalloc.so*
20+
...
21+
fun:tbb_aligned_malloc
22+
...
23+
}
24+
25+
{
26+
False-positive ConflictingAccess in libtbbmalloc.so
27+
drd:ConflictingAccess
28+
obj:*/libtbbmalloc.so*
29+
...
30+
fun:tbb_free
31+
...
32+
}
33+
34+
{
35+
False-positive ConflictingAccess in libtbbmalloc.so
36+
drd:ConflictingAccess
37+
obj:*/libtbbmalloc.so*
38+
...
39+
fun:__nptl_deallocate_tsd
40+
...
41+
}
42+
43+
{
44+
False-positive ConflictingAccess in _Z22pow2AlignedAllocHelperP17umf_memory_pool_t
45+
drd:ConflictingAccess
46+
fun:memset
47+
fun:_Z22pow2AlignedAllocHelperP17umf_memory_pool_t
48+
...
49+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
False-positive Race in libjemalloc.so
3+
Helgrind:Race
4+
obj:*/libjemalloc.so*
5+
...
6+
fun:mallocx
7+
...
8+
}
9+
10+
{
11+
False-positive Race in libjemalloc.so
12+
Helgrind:Race
13+
obj:*/libjemalloc.so*
14+
...
15+
fun:op_free
16+
...
17+
}
18+
19+
{
20+
False-positive Race in libjemalloc.so
21+
Helgrind:Race
22+
obj:*/libjemalloc.so*
23+
...
24+
fun:__nptl_deallocate_tsd
25+
...
26+
}
27+
28+
{
29+
False-positive Race in critnib_insert
30+
Helgrind:Race
31+
fun:store
32+
fun:critnib_insert
33+
...
34+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
False-positive Race in libtbbmalloc.so
3+
Helgrind:Race
4+
obj:*/libtbbmalloc.so*
5+
}
6+
7+
{
8+
False-positive Race in libtbbmalloc.so
9+
Helgrind:Race
10+
obj:*/libtbbmalloc.so*
11+
...
12+
fun:tbb_malloc
13+
...
14+
}
15+
16+
{
17+
False-positive Race in libtbbmalloc.so
18+
Helgrind:Race
19+
obj:*/libtbbmalloc.so*
20+
...
21+
fun:tbb_aligned_malloc
22+
...
23+
}
24+
25+
{
26+
False-positive Race in libtbbmalloc.so
27+
Helgrind:Race
28+
obj:*/libtbbmalloc.so*
29+
...
30+
fun:tbb_free
31+
...
32+
}
33+
34+
{
35+
False-positive Race in libtbbmalloc.so
36+
Helgrind:Race
37+
obj:*/libtbbmalloc.so*
38+
...
39+
fun:__nptl_deallocate_tsd
40+
...
41+
}
42+
43+
{
44+
False-positive Race in _Z22pow2AlignedAllocHelperP17umf_memory_pool_t
45+
Helgrind:Race
46+
fun:memset
47+
fun:_Z22pow2AlignedAllocHelperP17umf_memory_pool_t
48+
...
49+
}

0 commit comments

Comments
 (0)