Skip to contentSkip to conversation

numa_helper: don't break is_numa() with TCONF

PATCH New Jan Stancek 2 participants 3 messages Feb 22, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 numa_helper: don't break is_numa() with TCONF

----- Original Message -----

Quoted 7 lines

From: "Cyril Hrubis" <[email protected]>
To: "Jan Stancek" <[email protected]>
Cc: [email protected]
Sent: Monday, 22 February, 2016 2:25:22 PM
Subject: Re: [LTP] [PATCH] numa_helper: don't break is_numa() with TCONF

Hi!

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

And the same for is_numa(), it calls tst_brkm(TBROK | TERRNO, ...) in case that get_allowed_nodes_arr() returned non-zero.

If get_allowed_nodes_arr() returned non-zero because of get_mempolicy, that means get_mempolicy is implemented but failed. I think that justifies TBROK.

Now I'm confused. You said that the syscall can exit -1 and ENOSYS.

Correct, get_mempolicy is not implemented on aarch64.

Quoted 3 lines

In that case the filter_nodemask_mem() returns -2 which is propagated from get_allowed_nodes_arr() to is_numa() where the test ends with TBROK rather than with TCONF.

It won't return -2 for ENOSYS, because of this line:
+ if (ret < 0 && errno != ENOSYS)

                 return -2;
Quoted 1 line

Or did I miss something?

I didn't make it clear in commit message that patch now silently ignores ENOSYS from get_mempolicy. In this case get_allowed_nodes should return success, but returned node set should be empty (I'll double check that this is the case on aarch64).

Quoted 5 lines

--
Cyril Hrubis
[email protected]

#1 lore raw

PATCH 1/1 numa_helper: don't break is_numa() with TCONF

Hi!

Quoted 10 lines
Quoted 1 line

Now I'm confused. You said that the syscall can exit -1 and ENOSYS.

Correct, get_mempolicy is not implemented on aarch64.

Quoted 3 lines

In that case the filter_nodemask_mem() returns -2 which is propagated from get_allowed_nodes_arr() to is_numa() where the test ends with TBROK rather than with TCONF.

It won't return -2 for ENOSYS, because of this line:
+ if (ret < 0 && errno != ENOSYS)

Quoted 7 lines
                 return -2;
Quoted 1 line

Or did I miss something?

I didn't make it clear in commit message that patch now silently ignores ENOSYS from get_mempolicy. In this case get_allowed_nodes should return success, but returned node set should be empty (I'll double check that this is the case on aarch64).

Ah right I somehow missed that (I blame it on not enough coffe in bloodstream). So is_numa() returns 0 in that case, which is fine.

If node set is empty the get_allowed_nodes() will fail since the num_nodes will end up set to 0 and get_allowed_nodes() will return with -3 and errno EINVAL since we cannot set the requested node. And looks like at least oom04 and oom05 call TBROK if there isn't one allowed node.

Signature · 2 lines
Cyril Hrubis
[email protected]
#2 lore raw

PATCH 1/1 numa_helper: don't break is_numa() with TCONF

----- Original Message -----

Quoted 29 lines

From: "Cyril Hrubis" <[email protected]>
To: "Jan Stancek" <[email protected]>
Cc: [email protected]
Sent: Monday, 22 February, 2016 3:26:33 PM
Subject: Re: [LTP] [PATCH] numa_helper: don't break is_numa() with TCONF

Hi!

Quoted 13 lines
Quoted 1 line

Now I'm confused. You said that the syscall can exit -1 and ENOSYS.

Correct, get_mempolicy is not implemented on aarch64.

Quoted 4 lines

In that case the filter_nodemask_mem() returns -2 which is propagated from
get_allowed_nodes_arr() to is_numa() where the test ends with TBROK rather than with TCONF.

It won't return -2 for ENOSYS, because of this line:
+ if (ret < 0 && errno != ENOSYS)

                 return -2;
Quoted 8 lines
Quoted 1 line

Or did I miss something?

I didn't make it clear in commit message that patch now silently ignores ENOSYS
from get_mempolicy. In this case get_allowed_nodes should return success, but
returned node set should be empty (I'll double check that this is the case on aarch64).

Quoted 8 lines

Ah right I somehow missed that (I blame it on not enough coffe in bloodstream). So is_numa() returns 0 in that case, which is fine.

If node set is empty the get_allowed_nodes() will fail since the num_nodes will end up set to 0 and get_allowed_nodes() will return with -3 and errno EINVAL since we cannot set the requested node. And looks like at least oom04 and oom05 call TBROK if there isn't one allowed node.

True, these needs some fixing too. I'll check all instances of get_allowed_nodes().

Quoted 5 lines

--
Cyril Hrubis
[email protected]