public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] KVM guest page swap out support - take2
@ 2007-06-04  2:35 Shaohua Li
       [not found] ` <1180924515.4257.16.camel-yAZKuqJtXNMXR+D7ky4Foa2pdiUAq4bhAL8bYrjMMd8@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Shaohua Li @ 2007-06-04  2:35 UTC (permalink / raw)
  To: kvm-devel

[-- Attachment #1: Type: text/plain, Size: 782 bytes --]

Hi,
This is a updated patch set of swap out kvm guest pages.Changes are:
1. refresh against to kvm-26
2. clean up shadow page handling to make gfn_to_page not be called
within kmap_atomic/kunamp_atomic.
3. variant bug fixing. Now the patch is quite stable in my test.
4. make swap out optional. A compile option can completely close swap
out. There should be no performance impact if swapout isn't enabled.

There are still a lot of unresolved issues:
1. just work for one vm. waiting for kvm hook into scheduler
2. Not work for mp guest and can't swap out pages which shadow page
table point to, this require kvm .flush_tlb can send ipi to vcpu.
3. swapoff isn't supported. We need a hook to sys_swapoff for kvm.

Please review, suggests and comments are welcome.

Thanks,
Shaohua

[-- Attachment #2: export-symbol.patch --]
[-- Type: text/x-patch, Size: 2109 bytes --]

symbols swapout required

Index: 2.6.21-rc7/mm/swap_state.c
===================================================================
--- 2.6.21-rc7.orig/mm/swap_state.c	2007-04-24 02:20:00.000000000 +0800
+++ 2.6.21-rc7/mm/swap_state.c	2007-05-21 10:10:20.000000000 +0800
@@ -207,6 +207,7 @@ void delete_from_swap_cache(struct page 
 	swap_free(entry);
 	page_cache_release(page);
 }
+EXPORT_SYMBOL(delete_from_swap_cache);
 
 /*
  * Strange swizzling function only for use by shmem_writepage
@@ -225,6 +226,7 @@ int move_to_swap_cache(struct page *page
 		INC_CACHE_INFO(exist_race);
 	return err;
 }
+EXPORT_SYMBOL(move_to_swap_cache);
 
 /*
  * Strange swizzling function for shmem_getpage (and shmem_unuse)
@@ -307,6 +309,7 @@ struct page * lookup_swap_cache(swp_entr
 	INC_CACHE_INFO(find_total);
 	return page;
 }
+EXPORT_SYMBOL(lookup_swap_cache);
 
 /* 
  * Locate a page of swap in physical memory, reserving swap cache space
@@ -364,3 +367,4 @@ struct page *read_swap_cache_async(swp_e
 		page_cache_release(new_page);
 	return found_page;
 }
+EXPORT_SYMBOL(read_swap_cache_async);
Index: 2.6.21-rc7/mm/swapfile.c
===================================================================
--- 2.6.21-rc7.orig/mm/swapfile.c	2007-04-24 02:20:00.000000000 +0800
+++ 2.6.21-rc7/mm/swapfile.c	2007-05-21 10:10:20.000000000 +0800
@@ -211,6 +211,7 @@ noswap:
 	spin_unlock(&swap_lock);
 	return (swp_entry_t) {0};
 }
+EXPORT_SYMBOL(get_swap_page);
 
 swp_entry_t get_swap_page_of_type(int type)
 {
@@ -303,6 +304,7 @@ void swap_free(swp_entry_t entry)
 		spin_unlock(&swap_lock);
 	}
 }
+EXPORT_SYMBOL(swap_free);
 
 /*
  * How many references to page are currently swapped out?
Index: 2.6.21-rc7/mm/filemap.c
===================================================================
--- 2.6.21-rc7.orig/mm/filemap.c	2007-04-24 02:20:00.000000000 +0800
+++ 2.6.21-rc7/mm/filemap.c	2007-05-21 10:11:09.000000000 +0800
@@ -465,6 +465,7 @@ int add_to_page_cache_lru(struct page *p
 		lru_cache_add(page);
 	return ret;
 }
+EXPORT_SYMBOL(add_to_page_cache_lru);
 
 #ifdef CONFIG_NUMA
 struct page *__page_cache_alloc(gfp_t gfp)

[-- Attachment #3: kvm-swap.tgz --]
[-- Type: application/x-compressed-tar, Size: 8742 bytes --]

[-- Attachment #4: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #5: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-06-11  8:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-04  2:35 [RFC] KVM guest page swap out support - take2 Shaohua Li
     [not found] ` <1180924515.4257.16.camel-yAZKuqJtXNMXR+D7ky4Foa2pdiUAq4bhAL8bYrjMMd8@public.gmane.org>
2007-06-04 10:18   ` Avi Kivity
2007-06-05 14:17   ` Avi Kivity
     [not found]     ` <46657064.3090300-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-06-06  1:18       ` Shaohua Li
     [not found]         ` <1181092735.18478.4.camel-yAZKuqJtXNMXR+D7ky4Foa2pdiUAq4bhAL8bYrjMMd8@public.gmane.org>
2007-06-07  9:10           ` Shaohua Li
     [not found]             ` <1181207441.25189.5.camel-yAZKuqJtXNMXR+D7ky4Foa2pdiUAq4bhAL8bYrjMMd8@public.gmane.org>
2007-06-11  8:24               ` Shaohua Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox