Commit fc91668eaf9e7ba61e867fc2218b7e9fb67faa4f
Committed by
Linus Torvalds
1 parent
c475dab63a
Exists in
master
and in
20 other branches
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>
Showing 3 changed files with 5 additions and 9 deletions Side-by-side Diff
include/linux/gfp.h
... | ... | @@ -325,7 +325,7 @@ |
325 | 325 | |
326 | 326 | extern void __free_pages(struct page *page, unsigned int order); |
327 | 327 | extern void free_pages(unsigned long addr, unsigned int order); |
328 | -extern void free_hot_page(struct page *page); | |
328 | +extern void free_hot_cold_page(struct page *page, int cold); | |
329 | 329 | |
330 | 330 | #define __free_page(page) __free_pages((page), 0) |
331 | 331 | #define free_page(addr) free_pages((addr),0) |
mm/page_alloc.c
... | ... | @@ -1074,8 +1074,9 @@ |
1074 | 1074 | |
1075 | 1075 | /* |
1076 | 1076 | * Free a 0-order page |
1077 | + * cold == 1 ? free a cold page : free a hot page | |
1077 | 1078 | */ |
1078 | -static void free_hot_cold_page(struct page *page, int cold) | |
1079 | +void free_hot_cold_page(struct page *page, int cold) | |
1079 | 1080 | { |
1080 | 1081 | struct zone *zone = page_zone(page); |
1081 | 1082 | struct per_cpu_pages *pcp; |
... | ... | @@ -1135,11 +1136,6 @@ |
1135 | 1136 | local_irq_restore(flags); |
1136 | 1137 | } |
1137 | 1138 | |
1138 | -void free_hot_page(struct page *page) | |
1139 | -{ | |
1140 | - free_hot_cold_page(page, 0); | |
1141 | -} | |
1142 | - | |
1143 | 1139 | /* |
1144 | 1140 | * split_page takes a non-compound higher-order page, and splits it into |
1145 | 1141 | * n (1<<order) sub-pages: page[0..n] |
... | ... | @@ -2010,7 +2006,7 @@ |
2010 | 2006 | { |
2011 | 2007 | if (put_page_testzero(page)) { |
2012 | 2008 | if (order == 0) |
2013 | - free_hot_page(page); | |
2009 | + free_hot_cold_page(page, 0); | |
2014 | 2010 | else |
2015 | 2011 | __free_pages_ok(page, order); |
2016 | 2012 | } |