summaryrefslogtreecommitdiff
path: root/include/linux/mm_inline.h
diff options
context:
space:
mode:
authorHugh Dickins <hughd@google.com>2012-01-13 05:20:04 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-13 08:13:10 +0400
commit1c1c53d43b387d02174911ecb42ce846577b0ea0 (patch)
treebb1294b23d23f2403ab95068af6080b375cc3166 /include/linux/mm_inline.h
parent4111304dab198c687bc60f2e235a9f7ee92c47c8 (diff)
downloadlinux-1c1c53d43b387d02174911ecb42ce846577b0ea0.tar.xz
mm: remove del_page_from_lru, add page_off_lru
del_page_from_lru() repeats del_page_from_lru_list(), also working out which LRU the page was on, clearing the relevant bits. Decouple those functions: remove del_page_from_lru() and add page_off_lru(). Signed-off-by: Hugh Dickins <hughd@google.com> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/mm_inline.h')
-rw-r--r--include/linux/mm_inline.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h
index 8f84d2e53d0f..227fd3e9a9c9 100644
--- a/include/linux/mm_inline.h
+++ b/include/linux/mm_inline.h
@@ -54,8 +54,14 @@ static inline enum lru_list page_lru_base_type(struct page *page)
return LRU_INACTIVE_ANON;
}
-static inline void
-del_page_from_lru(struct zone *zone, struct page *page)
+/**
+ * page_off_lru - which LRU list was page on? clearing its lru flags.
+ * @page: the page to test
+ *
+ * Returns the LRU list a page was on, as an index into the array of LRU
+ * lists; and clears its Unevictable or Active flags, ready for freeing.
+ */
+static inline enum lru_list page_off_lru(struct page *page)
{
enum lru_list lru;
@@ -69,9 +75,7 @@ del_page_from_lru(struct zone *zone, struct page *page)
lru += LRU_ACTIVE;
}
}
- mem_cgroup_lru_del_list(page, lru);
- list_del(&page->lru);
- __mod_zone_page_state(zone, NR_LRU_BASE + lru, -hpage_nr_pages(page));
+ return lru;
}
/**
@@ -92,7 +96,6 @@ static inline enum lru_list page_lru(struct page *page)
if (PageActive(page))
lru += LRU_ACTIVE;
}
-
return lru;
}