[PATCH] Fix mbind_migrate_pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <ak@xxxxxxxxxxxxxxx>

diff -urp numactl-2.0.2/test/mbind_mig_pages.c numactl-2.0.2-hack//test/mbind_mig_pages.c
--- numactl-2.0.2/test/mbind_mig_pages.c	2008-08-05 16:36:58.000000000 +0200
+++ numactl-2.0.2-hack//test/mbind_mig_pages.c	2009-01-10 06:26:54.000000000 +0100
@@ -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++;
 	
-- 
ak@xxxxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-numa" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]     [Devices]

  Powered by Linux