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

[Xen-changelog] [xen staging] x86/mem-sharing: statically initialize audit list head and lock



commit 9efd36b5dd563cb2af7994c4b8af6e4a9e50e765
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Mon May 13 09:53:22 2019 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon May 13 09:53:22 2019 +0200

    x86/mem-sharing: statically initialize audit list head and lock
    
    There's no need to execute any instructions for doing so. Drop the then
    effectively empty mem_sharing_init() altogether.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: George Dunlap <george.dunlap@xxxxxxxxxx>
    Acked-by: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
---
 xen/arch/x86/mm.c                 |  2 --
 xen/arch/x86/mm/mem_sharing.c     | 14 ++------------
 xen/include/asm-x86/mem_sharing.h |  1 -
 3 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 45fadbab61..5e1b061d2a 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -368,8 +368,6 @@ void __init arch_init_memory(void)
 
     efi_init_memory();
 
-    mem_sharing_init();
-
 #ifndef NDEBUG
     if ( highmem_start )
     {
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5ac9d8f54c..03aafa57a6 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -65,8 +65,8 @@ static DEFINE_PER_CPU(pg_lock_data_t, __pld);
 
 #if MEM_SHARING_AUDIT
 
-static struct list_head shr_audit_list;
-static spinlock_t shr_audit_lock;
+static LIST_HEAD(shr_audit_list);
+static DEFINE_SPINLOCK(shr_audit_lock);
 static DEFINE_RCU_READ_LOCK(shr_audit_read_lock);
 
 /* RCU delayed free of audit list entry */
@@ -1650,13 +1650,3 @@ int mem_sharing_domctl(struct domain *d, struct 
xen_domctl_mem_sharing_op *mec)
 
     return rc;
 }
-
-void __init mem_sharing_init(void)
-{
-    printk("Initing memory sharing.\n");
-#if MEM_SHARING_AUDIT
-    spin_lock_init(&shr_audit_lock);
-    INIT_LIST_HEAD(&shr_audit_list);
-#endif
-}
-
diff --git a/xen/include/asm-x86/mem_sharing.h 
b/xen/include/asm-x86/mem_sharing.h
index 0e77b7d935..9f9f7e93e3 100644
--- a/xen/include/asm-x86/mem_sharing.h
+++ b/xen/include/asm-x86/mem_sharing.h
@@ -88,7 +88,6 @@ int mem_sharing_notify_enomem(struct domain *d, unsigned long 
gfn,
 int mem_sharing_memop(XEN_GUEST_HANDLE_PARAM(xen_mem_sharing_op_t) arg);
 int mem_sharing_domctl(struct domain *d, 
                        struct xen_domctl_mem_sharing_op *mec);
-void mem_sharing_init(void);
 
 /* Scans the p2m and relinquishes any shared pages, destroying 
  * those for which this domain holds the final reference.
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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