more numa maxnode confusions

Paul Jackson
2004-09-13T03:03:20Z

I believe that a merge error on my part is contributing further to the
confusions over the meaning of the 'maxnode' parameter to the numa
mbind/set_mempolicy/get_mempolicy calls. The question is whether
maxnode should be passed in as the number of bits, or one more than the
number of bits (64 or 65 if MAX_NUMNODES is 64, for example).

I will call these two choices the N64 and N65 choices.

As best as I can reconstruct the events, the following has happened over
the last month:

1) In the beginning, Andi designed this numa interface to be N65.

2) About Aug 9, Brent Casavant sent in a patch changing the set (not get)
side calls, sys_mbind and sys_set_mempolicy, to N64. This patch
removed the following line from the implementation of get_nodes() in
mm/mempolicy.c:

--maxnode;

3) Due presumably to a merge confusion on my part, my subsequent
cpuset patch (the original, largest one now dated Sept 2)
put this line back in, making the interface N65 again.

So currently, a quick reading of the code (could easily be wrong) tells
me that the compat interfaces and the 'get' side (get_mempolicy) are
always N65, but that the native 'set' side is N64 without my cpuset
patch (but with Brent's patch), but N65 with my cpuset patch, which adds
back in the "--maxnode" line to get_nodes().

Currently, by my reading, Linus' bk tree has the mixed N64/N65
interfaces, since it has Brent's patch, but not my cpuset patch.
Andrew's *-mm tree has the pure N65 interface, due to my cpuset patch
reversing Brent's patch.

My guess is that Andi wants this all N65, and that he didn't agree to
Brent's patch. If Andi understands different, that's fine -- I'm not
trying to reopen that battle.

Andi:

0) Are my above statements anywhere close to correct?

1) Should the "--maxnode" be re-inserted in get_nodes()?

2) Should it be re-inserted by a separate patch from you,
rather than as a hidden side affect of my cpuset patch?
I will gladly remove that line from my cpuset patch, in
favor of a one-liner from you that re-inserts that line.

Brent:

1) Would you agree to having your partial N64 patch reversed,
if my efforts to channel Andi's thoughts have succeeded,
and he wants the "--maxnode" in the code?

Andrew:

1) Once it's settled on where we (Andi, mostly) wants to go,
how do you want the patch(es)? It seems silly for me to
send in a patch that undoes the re-insertion, just so Andi
can send in another patch that redoes it. I will gladly do
pretty much anything you and Andi agree to here, but you may
have to spell it out to me in small, simple words ;).