linux-numa.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bitmask/nodemask strangeness with sparse node ids
@ 2012-02-20 14:18 Brice Goglin
  0 siblings, 0 replies; only message in thread
From: Brice Goglin @ 2012-02-20 14:18 UTC (permalink / raw
  To: linux-numa

Hello,

I am debugging some problems on a strange power7 virtual node that
contains 3 sparse-numbered NUMA nodes:
* node#0 has NO memory but many CPUs
* node#2 and #3 have memory but no CPUs

I am trying to understand what numa_all_nodes_ptr and friends are
supposed to contain. I see:
    numa_all_nodes_ptr = bits 2 & 3
This seems to match the manpage when it says "representing all nodes on
which the calling task may allocate memory". But it doesn't really match
when it says "a bit mask that has all available nodes set" above (should
be bits 0&2&3).

If I look at numa_all_nodes instead, I get bits 0 & 1. libnuma.c seems
to set as many first bits as there are nodes I can allocate from. But I
don't see anywhere in the code something that can deal with such
nodemask on sparse-numbered platforms. For instance,
copy_bitmask_to_nodemask(numa_all_nodes_ptr, foo) puts bits 2 & 3 in foo
while foo should be equal to numa_all_nodes.

So:
* is the nodemask API known to be broken when node ids are sparse?
* is the nodemask API officially deprecated? If so, could this be
clarified in the header and manpage? The definition of nodemask_t is
very close to the header of numa.h without anything saying "don't use it".
I actually think that everything nodemask_t related should be out of
numa.h and out of the manpage. If people should not use them, they
should be hidden. It could be moved in something like numacompat1.h for
instance. Right now, things are very confusing (especially when one
finds numa_allocate_nodemask() which returns a bitmask :))

Thanks
Brice Goglin

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-20 14:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-20 14:18 bitmask/nodemask strangeness with sparse node ids Brice Goglin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).