WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] xenpaging: munmap all pages after page-in

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xenpaging: munmap all pages after page-in
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Wed, 02 Nov 2011 18:37:26 +0100
Delivery-date: Wed, 02 Nov 2011 10:38:20 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1320255469; l=928; s=domk; d=aepfle.de; h=To:From:Date:Subject:Content-Transfer-Encoding:MIME-Version: Content-Type:X-RZG-CLASS-ID:X-RZG-AUTH; bh=OX53zo4e2zuN/W08XaIcnidXbPQ=; b=emmEumlEZLvldxpSsCfdqi0zCmbnLERRjCl2fZjtHMM5FhjPG+nsPT4aQtbvJ5hhI3j EilkTC3KrPxgK0/qQlqCJoM1UX0R5CwsT9odbcF7VA4b824FDZ2u+56ExpLCkxa8mO0wR E7xvzKqEeY5nMrjB2U3igB7BO6pp42z00XQ=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.7.5
# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1320254973 -3600
# Node ID 79677f532a2406ca501250b50fa8b33965a8d7d7
# Parent  951a9879c34bee1dd2fa0329a541ae089f271c11
xenpaging: munmap all pages after page-in

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@xxxxxxxxx>

diff -r 951a9879c34b -r 79677f532a24 tools/xenpaging/pagein.c
--- a/tools/xenpaging/pagein.c
+++ b/tools/xenpaging/pagein.c
@@ -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);

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>