Skip to content

Add OS provider tests for different bind modes #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

DamianDuy
Copy link

@DamianDuy DamianDuy commented Feb 19, 2024

No description provided.

@bratpiorka bratpiorka requested a review from PatKamin February 19, 2024 13:15
@igchor
Copy link
Member

igchor commented Feb 20, 2024

I don't know if this PR is supposed to cover entire #242 so feel free to address my comment in another PR:

We should check that policies like 'preferred' actually fall back to other nodes in case there is not enough memory on the specified node. Also, for modes that should fail if there is not enough memory we should test they actually do fail. One way to do that would be to add some kind of env variable which, if set, we could use to specify NUMA node on which we want to allocate (and use it for all binding tests). Then, we could run those tests in an environment with some custom NUMA nodes (e.g. we could create a very small NUMA node on pmem to make sure the oom is triggered quickly)

@DamianDuy DamianDuy force-pushed the addTestsBindModes branch 3 times, most recently from e6201b5 to 6281cf1 Compare February 23, 2024 13:02
@DamianDuy DamianDuy force-pushed the addTestsBindModes branch 4 times, most recently from c234727 to e63254b Compare March 4, 2024 11:27
@DamianDuy DamianDuy marked this pull request as ready for review March 7, 2024 09:05
@DamianDuy DamianDuy requested a review from a team as a code owner March 7, 2024 09:05
@DamianDuy DamianDuy force-pushed the addTestsBindModes branch 7 times, most recently from b098491 to 4596575 Compare March 13, 2024 16:45
@bratpiorka
Copy link
Contributor

@igchor @PatKamin @kswiecicki please review. I think the rest tests required for #242 would be added in separate PRs

ASSERT_EQ(umf_result, UMF_RESULT_SUCCESS);
ASSERT_NE(ptr, nullptr);

int cpu = sched_getcpu();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this test shouldn't be run on a randomized cpu. We don't have a guarantee that this test will be run on different numa nodes.

Maybe you could try parameterizing this test with all available cpus on which the process can be ran and using sched_setaffinity() or sth similar to run this test on each of available cpus. This way this test will cover all possible numa nodes with cpus in a multi-numa-node server.

// Test for allocations on numa nodes with interleave mode enabled.
// The page allocations are interleaved across the set of nodes specified in nodemask.
TEST_F(testNuma, checkModeInterleave) {
int num_page = 1024;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Make it a constexpr. Also, pages_num (a plural form) or sth like that would better describe what this var is for.

@@ -28,7 +30,17 @@ std::vector<int> get_available_numa_nodes_numbers() {
return available_numa_nodes_numbers;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is all about multiple numa nodes. I think there should be a check if the size of available numa nodes vector is greater than 1. Otherwise, we might think that we test umf on multiple numa nodes but actually testing just a single numa node.

::testing::ValuesIn(get_available_numa_nodes_numbers()));

// Test for allocations on numa nodes. This test will be executed for all numa nodes
// available on the system. The available nodes are returned in vector from the
// get_available_numa_nodes_numbers() function and passed to test as parameters.
TEST_P(testNumaNodes, checkNumaNodesAllocations) {
TEST_P(testNumaOnAllNodes, checkNumaNodesAllocations) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to have a test case for BIND where you set multiple NUMA nodes in node mask. This is allowed according to the documentation.


// Test for allocations on numa nodes with interleave mode enabled.
// The page allocations are interleaved across the set of nodes specified in nodemask.
TEST_F(testNuma, checkModeInterleave) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add a test where nodemask does not contain all NUMA nodes (e.g. a test with just one node).

@lukaszstolarczuk
Copy link
Contributor

@PatKamin, @igchor, can you please review your comments here and move them (if valid) to the new PR (#415). I didn't do any changes in tests, just rebased it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants