Fix mbind_migrate_pages
PATCH 1/1 Fix mbind_migrate_pages
The nodemask conversion of mbind_mig_pages had some off by one bugs, making the program always fail on 2 node systems.
Noticed by Jay Weinstein.
Signed-off-by Andi Kleen <[email protected]>
/test/mbind_mig_pages.c renamed from test/mbind_mig_pages.c +2 -2
@@ -91,7 +91,7 @@ int main(int argc, char **argv)/* Move to node zero */ printf ("\nMoving pages via mbind to node 0 ...\n" ); rc =mbind (pages, page_count * pagesize,MPOL_BIND , old_nodes->maskp, - old_nodes->size,MPOL_MF_MOVE |MPOL_MF_STRICT ); + old_nodes->size +1 ,MPOL_MF_MOVE |MPOL_MF_STRICT );if (rc <0 ) {perror ("mbind" ); errors++;
@@ -100,7 +100,7 @@ int main(int argc, char **argv)printf ("\nMoving pages via mbind from node 0 to 1 ...\n" ); rc =mbind (pages, page_count * pagesize,MPOL_BIND , new_nodes->maskp, - new_nodes->size,MPOL_MF_MOVE |MPOL_MF_STRICT ); + new_nodes->size +1 ,MPOL_MF_MOVE |MPOL_MF_STRICT );if (rc <0 ) {perror ("mbind" ); errors++;
Signature · 1 line
[email protected]