From: Joonsoo Kim Date: Fri, 9 Nov 2012 03:04:06 +0000 (+1100) Subject: mm, highmem: remove useless pool_lock X-Git-Tag: next-20121112~5^2~230 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5f3aced6271ff181ef01061b6d94902e1bc4ab04;p=karo-tx-linux.git mm, highmem: remove useless pool_lock The pool_lock protects the page_address_pool from concurrent access. But, access to the page_address_pool is already protected by kmap_lock. So remove it. Signed-off-by: Joonsoo Kim Cc: Mel Gorman Reviewed-by: Minchan Kin Cc: Peter Zijlstra Signed-off-by: Andrew Morton --- diff --git a/mm/highmem.c b/mm/highmem.c index 017ccccfb4aa..63083a2803ff 100644 --- a/mm/highmem.c +++ b/mm/highmem.c @@ -329,7 +329,6 @@ struct page_address_map { * page_address_map freelist, allocated from page_address_maps. */ static struct list_head page_address_pool; /* freelist */ -static spinlock_t pool_lock; /* protects page_address_pool */ /* * Hash table bucket @@ -396,11 +395,9 @@ void set_page_address(struct page *page, void *virtual) if (virtual) { /* Add */ BUG_ON(list_empty(&page_address_pool)); - spin_lock_irqsave(&pool_lock, flags); pam = list_entry(page_address_pool.next, struct page_address_map, list); list_del(&pam->list); - spin_unlock_irqrestore(&pool_lock, flags); pam->page = page; pam->virtual = virtual; @@ -414,9 +411,7 @@ void set_page_address(struct page *page, void *virtual) if (pam->page == page) { list_del(&pam->list); spin_unlock_irqrestore(&pas->lock, flags); - spin_lock_irqsave(&pool_lock, flags); list_add_tail(&pam->list, &page_address_pool); - spin_unlock_irqrestore(&pool_lock, flags); goto done; } } @@ -439,7 +434,6 @@ void __init page_address_init(void) INIT_LIST_HEAD(&page_address_htable[i].lh); spin_lock_init(&page_address_htable[i].lock); } - spin_lock_init(&pool_lock); } #endif /* defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) */