Message ID | 5CADCC560200007800226221@prv1-mh.provo.novell.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | xmalloc: statically initialize pool list head and lock | expand |
On 4/10/19 11:58 AM, Jan Beulich wrote: > There's no need to execute any instructions for doing so. > > Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: George Dunlap <george.dunlap@citrix.com>
On Wed, Apr 10, 2019 at 04:58:30AM -0600, Jan Beulich wrote: > There's no need to execute any instructions for doing so. > > Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Wei Liu <wei.liu2@citrix.com>
--- a/xen/common/xmalloc_tlsf.c +++ b/xen/common/xmalloc_tlsf.c @@ -65,8 +65,8 @@ #define PREV_FREE (0x2) #define PREV_USED (0x0) -static spinlock_t pool_list_lock; -static struct list_head pool_list_head; +static DEFINE_SPINLOCK(pool_list_lock); +static LIST_HEAD(pool_list_head); struct free_ptr { struct bhdr *prev; @@ -551,8 +551,6 @@ static void *xmalloc_whole_pages(unsigne static void tlsf_init(void) { - INIT_LIST_HEAD(&pool_list_head); - spin_lock_init(&pool_list_lock); xenpool = xmem_pool_create( "xmalloc", xmalloc_pool_get, xmalloc_pool_put, PAGE_SIZE, 0, PAGE_SIZE);
There's no need to execute any instructions for doing so. Signed-off-by: Jan Beulich <jbeulich@suse.com>