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-changelog

[Xen-changelog] [xen-unstable] xenpaging: allow negative num_pages and l

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xenpaging: allow negative num_pages and limit num_pages
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 27 Nov 2010 06:25:21 -0800
Delivery-date: Sat, 27 Nov 2010 06:27:14 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1290781239 0
# Node ID 1793318b35e65e055586d4d11622f9c9d4221d36
# Parent  7d2c013727d756e5c50726d9d55f108b006197dd
xenpaging: allow negative num_pages and limit num_pages

Simplify paging size argument. If a negative number is specified, it
means the entire guest memory should be paged out. This is useful for
debugging. Also limit num_pages to the guests max_pages.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
---
 tools/xenpaging/xenpaging.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff -r 7d2c013727d7 -r 1793318b35e6 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c       Fri Nov 26 14:20:10 2010 +0000
+++ b/tools/xenpaging/xenpaging.c       Fri Nov 26 14:20:39 2010 +0000
@@ -521,8 +521,6 @@ int main(int argc, char *argv[])
     domain_id = atoi(argv[1]);
     num_pages = atoi(argv[2]);
 
-    victims = calloc(num_pages, sizeof(xenpaging_victim_t));
-
     /* Seed random-number generator */
     srand(time(NULL));
 
@@ -542,6 +540,13 @@ int main(int argc, char *argv[])
         perror("failed to open file");
         return 2;
     }
+
+    if ( num_pages < 0 || num_pages > paging->domain_info->max_pages )
+    {
+        num_pages = paging->domain_info->max_pages;
+        DPRINTF("setting num_pages to %d\n", num_pages);
+    }
+    victims = calloc(num_pages, sizeof(xenpaging_victim_t));
 
     /* ensure that if we get a signal, we'll do cleanup, then exit */
     act.sa_handler = close_handler;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xenpaging: allow negative num_pages and limit num_pages, Xen patchbot-unstable <=