diff options
author | Olaf Hering <olaf@aepfle.de> | 2011-09-13 10:25:32 +0100 |
---|---|---|
committer | Olaf Hering <olaf@aepfle.de> | 2011-09-13 10:25:32 +0100 |
commit | 5b6fdcc0d8817b6b9bd896014784cc89385ed0bb (patch) | |
tree | b906afdfa0bcfd5411f66cf7a12b29a0573428c6 /tools/xenpaging/xenpaging.c | |
parent | d7d24473958dcf740d2366cbc574cf671e390dcc (diff) | |
download | xen-5b6fdcc0d8817b6b9bd896014784cc89385ed0bb.tar.gz xen-5b6fdcc0d8817b6b9bd896014784cc89385ed0bb.tar.bz2 xen-5b6fdcc0d8817b6b9bd896014784cc89385ed0bb.zip |
xenpaging: use batch of pages during final page-in
Map up to RING_SIZE pages in exit path to fill the ring instead of
populating one page at a time.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Diffstat (limited to 'tools/xenpaging/xenpaging.c')
-rw-r--r-- | tools/xenpaging/xenpaging.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c index 63b1e9f045..ebdba23db2 100644 --- a/tools/xenpaging/xenpaging.c +++ b/tools/xenpaging/xenpaging.c @@ -648,7 +648,7 @@ int main(int argc, char *argv[]) sigaction(SIGALRM, &act, NULL); /* listen for page-in events to stop pager */ - create_page_in_thread(paging->mem_event.domain_id, xch); + create_page_in_thread(paging); /* Evict pages */ for ( i = 0; i < paging->num_pages; i++ ) @@ -764,16 +764,24 @@ int main(int argc, char *argv[]) /* Write all pages back into the guest */ if ( interrupted == SIGTERM || interrupted == SIGINT ) { + int num = 0; for ( i = 0; i < paging->domain_info->max_pages; i++ ) { if ( test_bit(i, paging->bitmap) ) { - page_in_trigger(i); - break; + paging->pagein_queue[num] = i; + num++; + if ( num == XENPAGING_PAGEIN_QUEUE_SIZE ) + break; } } - /* If no more pages to process, exit loop */ - if ( i == paging->domain_info->max_pages ) + /* + * One more round if there are still pages to process. + * If no more pages to process, exit loop. + */ + if ( num ) + page_in_trigger(); + else if ( i == paging->domain_info->max_pages ) break; } else |