[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] tmem: cleanup: drop useless functions



commit d6e8fd32890b663bc449ab4b60e21dafb09bb821
Author:     Bob Liu <lliubbo@xxxxxxxxx>
AuthorDate: Fri Nov 8 09:03:57 2013 +0800
Commit:     Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
CommitDate: Tue Nov 12 10:15:26 2013 -0500

    tmem: cleanup: drop useless functions
    
    Function tmem_release_avail_pages_to_host() and tmem_scrub_page() only used
    once, no need to separate them out.
    
    Signed-off-by: Bob Liu <bob.liu@xxxxxxxxxx>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 xen/common/tmem.c          |   19 +++++++++++++++++--
 xen/common/tmem_xen.c      |   24 ------------------------
 xen/include/xen/tmem_xen.h |    3 ---
 3 files changed, 17 insertions(+), 29 deletions(-)

diff --git a/xen/common/tmem.c b/xen/common/tmem.c
index f009fd8..3d15ead 100644
--- a/xen/common/tmem.c
+++ b/xen/common/tmem.c
@@ -1418,7 +1418,19 @@ static unsigned long tmem_relinquish_npages(unsigned 
long n)
             break;
     }
     if ( avail_pages )
-        tmem_release_avail_pages_to_host();
+    {
+        spin_lock(&tmem_page_list_lock);
+        while ( !page_list_empty(&tmem_page_list) )
+        {
+            struct page_info *pg = page_list_remove_head(&tmem_page_list);
+            scrub_one_page(pg);
+            tmem_page_list_pages--;
+            free_domheap_page(pg);
+        }
+        ASSERT(tmem_page_list_pages == 0);
+        INIT_PAGE_LIST_HEAD(&tmem_page_list);
+        spin_unlock(&tmem_page_list_lock);
+    }
     return avail_pages;
 }
 
@@ -2911,9 +2923,12 @@ EXPORT void *tmem_relinquish_pages(unsigned int order, 
unsigned int memflags)
     }
     if ( evicts_per_relinq > max_evicts_per_relinq )
         max_evicts_per_relinq = evicts_per_relinq;
-    tmem_scrub_page(pfp, memflags);
     if ( pfp != NULL )
+    {
+        if ( !(memflags & MEMF_tmem) )
+            scrub_one_page(pfp);
         relinq_pgs++;
+    }
 
     if ( tmem_called_from_tmem(memflags) )
     {
diff --git a/xen/common/tmem_xen.c b/xen/common/tmem_xen.c
index 0f5955d..d6e2e0d 100644
--- a/xen/common/tmem_xen.c
+++ b/xen/common/tmem_xen.c
@@ -289,30 +289,6 @@ EXPORT DEFINE_SPINLOCK(tmem_page_list_lock);
 EXPORT PAGE_LIST_HEAD(tmem_page_list);
 EXPORT unsigned long tmem_page_list_pages = 0;
 
-/* free anything on tmem_page_list to Xen's scrub list */
-EXPORT void tmem_release_avail_pages_to_host(void)
-{
-    spin_lock(&tmem_page_list_lock);
-    while ( !page_list_empty(&tmem_page_list) )
-    {
-        struct page_info *pg = page_list_remove_head(&tmem_page_list);
-        scrub_one_page(pg);
-        tmem_page_list_pages--;
-        free_domheap_page(pg);
-    }
-    ASSERT(tmem_page_list_pages == 0);
-    INIT_PAGE_LIST_HEAD(&tmem_page_list);
-    spin_unlock(&tmem_page_list_lock);
-}
-
-EXPORT void tmem_scrub_page(struct page_info *pi, unsigned int memflags)
-{
-    if ( pi == NULL )
-        return;
-    if ( !(memflags & MEMF_tmem) )
-        scrub_one_page(pi);
-}
-
 static noinline void *tmem_mempool_page_get(unsigned long size)
 {
     struct page_info *pi;
diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h
index f9639a5..034fd5c 100644
--- a/xen/include/xen/tmem_xen.h
+++ b/xen/include/xen/tmem_xen.h
@@ -42,9 +42,6 @@ extern void tmem_copy_page(char *to, char*from);
 extern int tmem_init(void);
 #define tmem_hash hash_long
 
-extern void tmem_release_avail_pages_to_host(void);
-extern void tmem_scrub_page(struct page_info *pi, unsigned int memflags);
-
 extern bool_t opt_tmem_compress;
 static inline bool_t tmem_compression_enabled(void)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.