diff mbox series

x86/mem-sharing: statically initialize audit list head and lock

Message ID 5CADCC40020000780022621E@prv1-mh.provo.novell.com (mailing list archive)
State Superseded
Headers show
Series x86/mem-sharing: statically initialize audit list head and lock | expand

Commit Message

Jan Beulich April 10, 2019, 10:58 a.m. UTC
There's no need to execute any instructions for doing so.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
I wonder whether mem_sharing_init() shouldn't go away altogether then.

Comments

Andrew Cooper April 10, 2019, 11:13 a.m. UTC | #1
On 10/04/2019 11:58, Jan Beulich wrote:
> There's no need to execute any instructions for doing so.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> I wonder whether mem_sharing_init() shouldn't go away altogether then.

I vote for removing it completely.  The printk is a out-of-character
compared to other subsystems in Xen.

Either way, Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
George Dunlap April 10, 2019, 11:20 a.m. UTC | #2
On 4/10/19 12:13 PM, Andrew Cooper wrote:
> On 10/04/2019 11:58, Jan Beulich wrote:
>> There's no need to execute any instructions for doing so.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> ---
>> I wonder whether mem_sharing_init() shouldn't go away altogether then.
> 
> I vote for removing it completely.  The printk is a out-of-character
> compared to other subsystems in Xen.

+1
Jan Beulich April 10, 2019, 12:17 p.m. UTC | #3
>>> On 10.04.19 at 13:20, <george.dunlap@citrix.com> wrote:
> On 4/10/19 12:13 PM, Andrew Cooper wrote:
>> On 10/04/2019 11:58, Jan Beulich wrote:
>>> There's no need to execute any instructions for doing so.
>>>
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>> ---
>>> I wonder whether mem_sharing_init() shouldn't go away altogether then.
>> 
>> I vote for removing it completely.  The printk is a out-of-character
>> compared to other subsystems in Xen.
> 
> +1

In any event I'll wait for Tamas'es opinion. There might be plans to put
further meat into the function, after all.

Jan
Tamas K Lengyel April 10, 2019, 1:23 p.m. UTC | #4
On Wed, Apr 10, 2019 at 6:17 AM Jan Beulich <JBeulich@suse.com> wrote:
>
> >>> On 10.04.19 at 13:20, <george.dunlap@citrix.com> wrote:
> > On 4/10/19 12:13 PM, Andrew Cooper wrote:
> >> On 10/04/2019 11:58, Jan Beulich wrote:
> >>> There's no need to execute any instructions for doing so.
> >>>
> >>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >>> ---
> >>> I wonder whether mem_sharing_init() shouldn't go away altogether then.
> >>
> >> I vote for removing it completely.  The printk is a out-of-character
> >> compared to other subsystems in Xen.
> >
> > +1
>
> In any event I'll wait for Tamas'es opinion. There might be plans to put
> further meat into the function, after all.

+1 from me too, no plans on adding stuff here.

Thanks,
Tamas
diff mbox series

Patch

--- 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, __
 
 #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 */
@@ -1654,9 +1654,5 @@  int mem_sharing_domctl(struct domain *d,
 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
 }