[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen staging] xmalloc: statically initialize pool list head and lock
commit 85aea83d46d24eb420235b172cd3f427a8153c18 Author: Jan Beulich <jbeulich@xxxxxxxx> AuthorDate: Thu Apr 11 10:25:22 2019 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Thu Apr 11 10:25:22 2019 +0200 xmalloc: statically initialize pool list head and lock There's no need to execute any instructions for doing so. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: George Dunlap <george.dunlap@xxxxxxxxxx> Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- xen/common/xmalloc_tlsf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c index b256dc56cf..2076953ac4 100644 --- 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(unsigned long size, unsigned long align) 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); -- generated by git-patchbot for /home/xen/git/xen.git#staging _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |