Skip to contentSkip to conversation

page-allocator: Remove dead function free_cold_page()

PATCH In review Mel Gorman 3 participants 4 messages Aug 5, 2009 – Aug 6, 2009

Subsystems (3)
lore
Share & tools
lore

Mel Gorman

author
#0 lore raw

PATCH 1/1 page-allocator: Remove dead function free_cold_page()

The function free_cold_page() has no callers so delete it.

---

 include/linux/gfp.h |    1 -
 mm/page_alloc.c     |    5 -----
 2 files changed, 6 deletions(-)
include/linux/gfp.h +0 -1
index 7c777a0..c32bfa8 100644
@@ -326,7 +326,6 @@ void free_pages_exact(void *virt, size_t size);
 extern void __free_pages(struct page *page, unsigned int order);
 extern void free_pages(unsigned long addr, unsigned int order);
 extern void free_hot_page(struct page *page);
-extern void free_cold_page(struct page *page);
 
 #define __free_page(page) __free_pages((page), 0)
 #define free_page(addr) free_pages((addr),0)
mm/page_alloc.c +0 -5
index d052abb..36758db 100644
@@ -1065,11 +1065,6 @@ void free_hot_page(struct page *page)
 	free_hot_cold_page(page, 0);
 }
 	
-void free_cold_page(struct page *page)
-{
-	free_hot_cold_page(page, 1);
-}
-
 /*
  * split_page takes a non-compound higher-order page, and splits it into
  * n (1<<order) sub-pages: page[0..n]

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

maintainer
#1 lore raw
Quoted 26 lines · On Wed, 5 Aug 2009 11:28:17 +0100 Mel Gorman <[email protected]> wrote:

The function free_cold_page() has no callers so delete it.

---

 include/linux/gfp.h |    1 -
 mm/page_alloc.c     |    5 -----
 2 files changed, 6 deletions(-)
include/linux/gfp.h +0 -1
index 7c777a0..c32bfa8 100644
@@ -326,7 +326,6 @@ void free_pages_exact(void *virt, size_t size);
 extern void __free_pages(struct page *page, unsigned int order);
 extern void free_pages(unsigned long addr, unsigned int order);
 extern void free_hot_page(struct page *page);
-extern void free_cold_page(struct page *page);
 
 #define __free_page(page) __free_pages((page), 0)
 #define free_page(addr) free_pages((addr),0)
mm/page_alloc.c +0 -0
index d052abb..36758db 100644
@@ -1065,11 +1065,6 @@ void free_hot_page(struct page *page)
 	free_hot_cold_page(page, 0);

mm/page_alloc.c void free_hot_page(struct page *page) · line 1070

Quoted 10 lines
mm/page_alloc.c +0 -5
 }
 
-void free_cold_page(struct page *page)
-{
-	free_hot_cold_page(page, 1);
-}
-
 /*
  * split_page takes a non-compound higher-order page, and splits it into
  * n (1<<order) sub-pages: page[0..n]

Well I spose so. But the function is valid and might need to be resurrected at any stage. We could `#if 0' it to save a few bytes of text, perhaps.

I wonder how many free_page() callers should really be calling free_cold_page(). c'mon, write a thingy to work it out ;) You can query a page's hotness by timing how long it takes to read all its cachelines.

#2 lore raw

2009/8/6 Andrew Morton <[email protected]>:

Quoted 43 lines · On Wed, 5 Aug 2009 11:28:17 +0100 Mel Gorman <[email protected]> wrote:
Quoted 27 lines

The function free_cold_page() has no callers so delete it.

---
 include/linux/gfp.h |    1 -
 mm/page_alloc.c     |    5 -----

 2 files changed, 6 deletions(-)
include/linux/gfp.h +0 -1
index 7c777a0..c32bfa8 100644
@@ -326,7 +326,6 @@ void free_pages_exact(void *virt, size_t size);
  extern void __free_pages(struct page *page, unsigned int order);
  extern void free_pages(unsigned long addr, unsigned int order);
  extern void free_hot_page(struct page *page);
-extern void free_cold_page(struct page *page);
 
  #define __free_page(page) __free_pages((page), 0)
  #define free_page(addr) free_pages((addr),0)
mm/page_alloc.c +0 -0
index d052abb..36758db 100644
@@ -1065,11 +1065,6 @@ void free_hot_page(struct page *page)
       free_hot_cold_page(page, 0);

mm/page_alloc.c void free_hot_page(struct page *page) · line 1070

Quoted 10 lines
mm/page_alloc.c +0 -5
  }
 
-void free_cold_page(struct page *page)
-{
-     free_hot_cold_page(page, 1);
-}
-
  /*
   * split_page takes a non-compound higher-order page, and splits it into
   * n (1<<order) sub-pages: page[0..n]

Well I spose so.  But the function is valid and might need to be resurrected at any stage.  We could `#if 0' it to save a few bytes of text, perhaps.

Quoted 4 lines

I wonder how many free_page() callers should really be calling free_cold_page().  c'mon, write a thingy to work it out ;) You can query a page's hotness by timing how long it takes to read all its cachelines.

if we decide to keep this function, I think we also need to consider make it exporting.
Driver developers never user unexported function.

Or, Can we free_hot_page() and free_cold_page move to inlined function?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

author
#3 lore raw
In reply to Andrew Morton
Quoted 30 lines · Andrew Morton
Quoted 28 lines · On Wed, 5 Aug 2009 11:28:17 +0100 Mel Gorman <[email protected]> wrote:

The function free_cold_page() has no callers so delete it.

---

 include/linux/gfp.h |    1 -
 mm/page_alloc.c     |    5 -----
 2 files changed, 6 deletions(-)
include/linux/gfp.h +0 -1
index 7c777a0..c32bfa8 100644
@@ -326,7 +326,6 @@ void free_pages_exact(void *virt, size_t size);
 extern void __free_pages(struct page *page, unsigned int order);
 extern void free_pages(unsigned long addr, unsigned int order);
 extern void free_hot_page(struct page *page);
-extern void free_cold_page(struct page *page);
 
 #define __free_page(page) __free_pages((page), 0)
 #define free_page(addr) free_pages((addr),0)
mm/page_alloc.c +0 -0
index d052abb..36758db 100644
@@ -1065,11 +1065,6 @@ void free_hot_page(struct page *page)
 	free_hot_cold_page(page, 0);
 }
 
Quoted 13 lines

mm/page_alloc.c void free_hot_page(struct page *page) · line 1070

Quoted 8 lines
mm/page_alloc.c +0 -5
-void free_cold_page(struct page *page)
-{
-	free_hot_cold_page(page, 1);
-}
-
 /*
  * split_page takes a non-compound higher-order page, and splits it into
  * n (1<<order) sub-pages: page[0..n]

Well I spose so. But the function is valid and might need to be resurrected at any stage. We could `#if 0' it to save a few bytes of text, perhaps.

We could although the code is so trivial, it's not like it's hard to reimplement.

Quoted 5 lines

I wonder how many free_page() callers should really be calling free_cold_page(). c'mon, write a thingy to work it out ;) You can query a page's hotness by timing how long it takes to read all its cachelines.

Hmm, interesting idea, I'll give it more of a think and see what falls out!

Signature · 9 lines
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>