aboutsummaryrefslogtreecommitdiffstats
path: root/mm/highmem.c
diff options
context:
space:
mode:
authorJoonsoo Kim <js1304@gmail.com>2012-12-11 19:01:23 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-11 20:22:24 -0500
commita354e2c84eeebcd7d7bbdd71216895b8e9866b5c (patch)
tree78decaf4fd709e64ca4f521abec6838a6f20263b /mm/highmem.c
parentcc33a303f1c155cf0147964586bb80fa732d8a21 (diff)
mm, highmem: remove page_address_pool list
We can find free page_address_map instance without the page_address_pool. So remove it. Signed-off-by: Joonsoo Kim <js1304@gmail.com> Cc: Mel Gorman <mel@csn.ul.ie> Reviewed-by: Minchan Kim <minchan@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/highmem.c')
-rw-r--r--mm/highmem.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/mm/highmem.c b/mm/highmem.c
index f0f0f1d5e691..4d6f96c20191 100644
--- a/mm/highmem.c
+++ b/mm/highmem.c
@@ -324,10 +324,7 @@ struct page_address_map {
324 struct list_head list; 324 struct list_head list;
325}; 325};
326 326
327/* 327static struct page_address_map page_address_maps[LAST_PKMAP];
328 * page_address_map freelist, allocated from page_address_maps.
329 */
330static struct list_head page_address_pool; /* freelist */
331 328
332/* 329/*
333 * Hash table bucket 330 * Hash table bucket
@@ -392,12 +389,7 @@ void set_page_address(struct page *page, void *virtual)
392 389
393 pas = page_slot(page); 390 pas = page_slot(page);
394 if (virtual) { /* Add */ 391 if (virtual) { /* Add */
395 BUG_ON(list_empty(&page_address_pool)); 392 pam = &page_address_maps[PKMAP_NR((unsigned long)virtual)];
396
397 pam = list_entry(page_address_pool.next,
398 struct page_address_map, list);
399 list_del(&pam->list);
400
401 pam->page = page; 393 pam->page = page;
402 pam->virtual = virtual; 394 pam->virtual = virtual;
403 395
@@ -410,7 +402,6 @@ void set_page_address(struct page *page, void *virtual)
410 if (pam->page == page) { 402 if (pam->page == page) {
411 list_del(&pam->list); 403 list_del(&pam->list);
412 spin_unlock_irqrestore(&pas->lock, flags); 404 spin_unlock_irqrestore(&pas->lock, flags);
413 list_add_tail(&pam->list, &page_address_pool);
414 goto done; 405 goto done;
415 } 406 }
416 } 407 }
@@ -420,15 +411,10 @@ done:
420 return; 411 return;
421} 412}
422 413
423static struct page_address_map page_address_maps[LAST_PKMAP];
424
425void __init page_address_init(void) 414void __init page_address_init(void)
426{ 415{
427 int i; 416 int i;
428 417
429 INIT_LIST_HEAD(&page_address_pool);
430 for (i = 0; i < ARRAY_SIZE(page_address_maps); i++)
431 list_add(&page_address_maps[i].list, &page_address_pool);
432 for (i = 0; i < ARRAY_SIZE(page_address_htable); i++) { 418 for (i = 0; i < ARRAY_SIZE(page_address_htable); i++) {
433 INIT_LIST_HEAD(&page_address_htable[i].lh); 419 INIT_LIST_HEAD(&page_address_htable[i].lh);
434 spin_lock_init(&page_address_htable[i].lock); 420 spin_lock_init(&page_address_htable[i].lock);