diff options
Diffstat (limited to 'include/linux/mm_inline.h')
| -rw-r--r-- | include/linux/mm_inline.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 8835b877b8db..8f7d24712dc1 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef LINUX_MM_INLINE_H | 1 | #ifndef LINUX_MM_INLINE_H |
| 2 | #define LINUX_MM_INLINE_H | 2 | #define LINUX_MM_INLINE_H |
| 3 | 3 | ||
| 4 | #include <linux/huge_mm.h> | ||
| 5 | |||
| 4 | /** | 6 | /** |
| 5 | * page_is_file_cache - should the page be on a file LRU or anon LRU? | 7 | * page_is_file_cache - should the page be on a file LRU or anon LRU? |
| 6 | * @page: the page to test | 8 | * @page: the page to test |
| @@ -20,18 +22,25 @@ static inline int page_is_file_cache(struct page *page) | |||
| 20 | } | 22 | } |
| 21 | 23 | ||
| 22 | static inline void | 24 | static inline void |
| 23 | add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l) | 25 | __add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l, |
| 26 | struct list_head *head) | ||
| 24 | { | 27 | { |
| 25 | list_add(&page->lru, &zone->lru[l].list); | 28 | list_add(&page->lru, head); |
| 26 | __inc_zone_state(zone, NR_LRU_BASE + l); | 29 | __mod_zone_page_state(zone, NR_LRU_BASE + l, hpage_nr_pages(page)); |
| 27 | mem_cgroup_add_lru_list(page, l); | 30 | mem_cgroup_add_lru_list(page, l); |
| 28 | } | 31 | } |
| 29 | 32 | ||
| 30 | static inline void | 33 | static inline void |
| 34 | add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l) | ||
| 35 | { | ||
| 36 | __add_page_to_lru_list(zone, page, l, &zone->lru[l].list); | ||
| 37 | } | ||
| 38 | |||
| 39 | static inline void | ||
| 31 | del_page_from_lru_list(struct zone *zone, struct page *page, enum lru_list l) | 40 | del_page_from_lru_list(struct zone *zone, struct page *page, enum lru_list l) |
| 32 | { | 41 | { |
| 33 | list_del(&page->lru); | 42 | list_del(&page->lru); |
| 34 | __dec_zone_state(zone, NR_LRU_BASE + l); | 43 | __mod_zone_page_state(zone, NR_LRU_BASE + l, -hpage_nr_pages(page)); |
| 35 | mem_cgroup_del_lru_list(page, l); | 44 | mem_cgroup_del_lru_list(page, l); |
| 36 | } | 45 | } |
| 37 | 46 | ||
| @@ -66,7 +75,7 @@ del_page_from_lru(struct zone *zone, struct page *page) | |||
| 66 | l += LRU_ACTIVE; | 75 | l += LRU_ACTIVE; |
| 67 | } | 76 | } |
| 68 | } | 77 | } |
| 69 | __dec_zone_state(zone, NR_LRU_BASE + l); | 78 | __mod_zone_page_state(zone, NR_LRU_BASE + l, -hpage_nr_pages(page)); |
| 70 | mem_cgroup_del_lru_list(page, l); | 79 | mem_cgroup_del_lru_list(page, l); |
| 71 | } | 80 | } |
| 72 | 81 | ||
