Не в состоянии сделать запрос через move_pages () - PullRequest
0 голосов
/ 06 февраля 2019

Я пытаюсь переместить страницу в NUMA 0:

if (0 != move_pages(getpid(), nPages, &ptrToSHM, nodes, status, MPOL_MF_MOVE_ALL)) {
    std::cout << "failed to move pages for /dev/shm/" << name << " to NUMA " << numaNodeID << " because " << strerror(errno) << std::endl;
}

Возвращается ноль, а затем я проверяю, где находятся эти страницы после move_pages(), с именем:

if (0 != move_pages(0, nPages, &ptrToSHM, nullptr, status, 0)) {
    std::cout << "failed to inquiry pages for /dev/shm/" << name << " because " << strerror(errno) << std::endl;
}
else {
    for (uint32_t i = 0; i < nPages; i++) {
        std::cout << "/dev/shm/" << name << "'s page # " << i << " locate at numa node " << status[i] << std::endl;
    }
}

И он печатает:

/dev/shm/test's page # 0 locate at numa node -2
/dev/shm/test's page # 1 locate at numa node -14

Согласно manpage , он гласит:

nodes is an array of integers that specify the desired location for each page.
Each element in the array is a node number. nodes can also be NULL, in which 
case move_pages() does not move any pages but instead will return the node where 
each page currently resides, in the status array. Obtaining the status of each 
page may be necessary to determine pages that need to be moved.

Почему он печатает отрицательные значения, хотяи движущиеся страницы, и запрос об успешном возврате?

PS Я также попробовал numa_move_pages(), что дало тот же результат, что и numa_move_pages() только вызовы move_pages().

...