mm: remove free_hot_page()

free_hot_page() is just a wrapper around free_hot_cold_page() with
parameter 'cold = 0'.  After adding a clear comment for
free_hot_cold_page(), it is reasonable to remove a level of call.

[akpm@linux-foundation.org: fix build]
Signed-off-by: Li Hong <lihong.hi@gmail.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Rik van Riel <riel@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Larry Woodman <lwoodman@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Li Ming Chun <macli@brc.ubc.ca>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Americo Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Li Hong 2010-03-05 13:41:54 -08:00 committed by Linus Torvalds
parent c475dab63a
commit fc91668eaf
3 changed files with 5 additions and 9 deletions

View file

@ -325,7 +325,7 @@ void free_pages_exact(void *virt, size_t size);
extern void __free_pages(struct page *page, unsigned int order); extern void __free_pages(struct page *page, unsigned int order);
extern void free_pages(unsigned long addr, unsigned int order); extern void free_pages(unsigned long addr, unsigned int order);
extern void free_hot_page(struct page *page); extern void free_hot_cold_page(struct page *page, int cold);
#define __free_page(page) __free_pages((page), 0) #define __free_page(page) __free_pages((page), 0)
#define free_page(addr) free_pages((addr),0) #define free_page(addr) free_pages((addr),0)

View file

@ -1074,8 +1074,9 @@ void mark_free_pages(struct zone *zone)
/* /*
* Free a 0-order page * Free a 0-order page
* cold == 1 ? free a cold page : free a hot page
*/ */
static void free_hot_cold_page(struct page *page, int cold) void free_hot_cold_page(struct page *page, int cold)
{ {
struct zone *zone = page_zone(page); struct zone *zone = page_zone(page);
struct per_cpu_pages *pcp; struct per_cpu_pages *pcp;
@ -1135,11 +1136,6 @@ static void free_hot_cold_page(struct page *page, int cold)
local_irq_restore(flags); local_irq_restore(flags);
} }
void free_hot_page(struct page *page)
{
free_hot_cold_page(page, 0);
}
/* /*
* split_page takes a non-compound higher-order page, and splits it into * split_page takes a non-compound higher-order page, and splits it into
* n (1<<order) sub-pages: page[0..n] * n (1<<order) sub-pages: page[0..n]
@ -2010,7 +2006,7 @@ void __free_pages(struct page *page, unsigned int order)
{ {
if (put_page_testzero(page)) { if (put_page_testzero(page)) {
if (order == 0) if (order == 0)
free_hot_page(page); free_hot_cold_page(page, 0);
else else
__free_pages_ok(page, order); __free_pages_ok(page, order);
} }

View file

@ -55,7 +55,7 @@ static void __page_cache_release(struct page *page)
del_page_from_lru(zone, page); del_page_from_lru(zone, page);
spin_unlock_irqrestore(&zone->lru_lock, flags); spin_unlock_irqrestore(&zone->lru_lock, flags);
} }
free_hot_page(page); free_hot_cold_page(page, 0);
} }
static void put_compound_page(struct page *page) static void put_compound_page(struct page *page)