]> xenbits.xensource.com Git - xen.git/commitdiff
xenpaging: munmap all pages after page-in
authorOlaf Hering <olaf@aepfle.de>
Mon, 14 Nov 2011 17:49:14 +0000 (17:49 +0000)
committerOlaf Hering <olaf@aepfle.de>
Mon, 14 Nov 2011 17:49:14 +0000 (17:49 +0000)
Do munmap() on all mapped pages, not just the first one.  Without this
change the gfns backing the remaining pages can not be paged out again
because the page count does not go down to 1. This change was missing
from changeset 23827:d1d6abc1db20.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/xenpaging/pagein.c

index e2d784089447ccd69ed8c0b9f5c9799996f4e46c..579620f2413e47ddb48f00aa1be07665d90cd5a5 100644 (file)
@@ -44,7 +44,7 @@ static void *page_in(void *arg)
         /* Ignore errors */
         page = xc_map_foreign_pages(pia->xch, pia->dom, PROT_READ, gfns, num);
         if (page)
-            munmap(page, PAGE_SIZE);
+            munmap(page, PAGE_SIZE * num);
     }
     page_in_possible = 0;
     pthread_exit(NULL);