In C, Migrate memory to a NUMA node -
i developing numa application , need migrate big arrays node (the node created) node.
i can't use numa_alloc_onnode()
function because need have shared memory between process allocates memory , child.
the situation following:
i have array (which dimension equal number of numa nodes) of (big) node* array, node* typedef of struct:
node** overall_trees;
i-th node* array have in i-th numa node.
what have done is:
overall_trees[i] = mmap(null,(1+number_of_nodes)*sizeof(node), prot_read | prot_write, map_shared | map_anonymous, -1, 0); numa_move_pages(0, (int) (1+number_of_nodes)*sizeof(node) / page_size, &overall_trees[i], &i, &status, mpol_mf_move);
but numa_move_pages()
returns -1.
actually first time in dealing numa allocation , maybe trying totally wrong. if different solution possible, feel free expose it.
thank you
wiki
Comments
Post a Comment