Re: move_pages fails on 2 node system

Ganapatrao Kulkarni <[email protected]> Wed, 17 Sep 2014 09:01:09 +0530
Newsgroups org.kernel.vger.linux-numa
Message-ID <CAFpQJXXViCbqcWxtHa2A1dN-gNOLg3_n7Q+HAXU14bv3S2LuVw@mail.gmail.com>
On Wed, Sep 17, 2014 at 4:08 AM, David Rientjes <[email protected]> wrote:
> On Tue, 16 Sep 2014, Filipe Brandenburger wrote:
>
>> On Tue, Sep 16, 2014 at 1:22 PM, David Rientjes <[email protected]> wrote:
>> > If this patch fixes it, then why is numa_max_node() returning 1 on a 2
>> > node system?
>>
>> Because the node ids are 0 and 1 :-)
>>
>> Patch makes sense to me. In particular, both test/migrate_pages.c and
>> test/mbind_mig_pages.c have "nr_nodes = numa_max_node()+1;" in them.
>>
>
> Patch makes no sense to me if there's no node 0.
yes, one more bug(likely), if no nodes, this function should return
-1, but it returns 0.
for no nodes case, if function returns -1, then +1 makes sense for all cases.
--- libnuma.c.orig      2014-09-17 08:58:21.119671188 +0530
+++ libnuma.c   2014-09-17 08:59:14.731333190 +0530
@@ -330,7 +330,7 @@

        d = opendir("/sys/devices/system/node");
        if (!d) {
-               maxconfigurednode = 0;
+               maxconfigurednode = -1;
        } else {
                while ((de = readdir(d)) != NULL) {
                        int nd;



thanks
Ganapat