diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-04-12 19:23:02 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-04-12 19:23:02 -0700 |
| commit | 467769abc79de002e75cdfb0d8f43695dfb4ffab (patch) | |
| tree | be7335fadf26a84c6776d10d63329a59bc7db7d5 | |
| parent | 03e95cafe7417e31fa78e827d714e1c077ab089e (diff) | |
[PATCH] uninline put_page()
Shrinks my vmlinux by an astonishing 28k.
text data bss dec hex filename
3038796 589890 150612 3779298 39aae2 vmlinux.before
3009761 590107 150612 3750480 393a50 vmlinux.after
Thanks to Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua> for performing
the analysis.
| -rw-r--r-- | include/linux/mm.h | 17 | ||||
| -rw-r--r-- | mm/swap.c | 21 |
2 files changed, 22 insertions, 16 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index d453a0ab62a7..14dba1b26016 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -255,22 +255,7 @@ static inline void get_page(struct page *page) atomic_inc(&page->count); } -static inline void put_page(struct page *page) -{ - if (unlikely(PageCompound(page))) { - page = (struct page *)page->private; - if (put_page_testzero(page)) { - if (page[1].mapping) { /* destructor? */ - (*(void (*)(struct page *))page[1].mapping)(page); - } else { - __page_cache_release(page); - } - } - return; - } - if (!PageReserved(page) && put_page_testzero(page)) - __page_cache_release(page); -} +void put_page(struct page *page); #else /* CONFIG_HUGETLB_PAGE */ diff --git a/mm/swap.c b/mm/swap.c index c20d079a0729..5d267915d945 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -34,6 +34,27 @@ /* How many pages do we try to swap or page in/out together? */ int page_cluster; +#ifdef CONFIG_HUGETLB_PAGE + +void put_page(struct page *page) +{ + if (unlikely(PageCompound(page))) { + page = (struct page *)page->private; + if (put_page_testzero(page)) { + if (page[1].mapping) { /* destructor? */ + (*(void (*)(struct page *))page[1].mapping)(page); + } else { + __page_cache_release(page); + } + } + return; + } + if (!PageReserved(page) && put_page_testzero(page)) + __page_cache_release(page); +} +EXPORT_SYMBOL(put_page); +#endif + /* * Writeback is about to end against a page which has been marked for immediate * reclaim. If it still appears to be reclaimable, move it to the tail of the |
