diff options
author | Rik van Riel <riel@redhat.com> | 2011-01-13 18:47:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 20:32:46 -0500 |
commit | 2c888cfbc1b45508a44763d85ba2e8ac43faff5f (patch) | |
tree | 9a7f2214e5d6a01d5724ae63d4d50cddeb2293ff /include/linux/mm_inline.h | |
parent | 97562cd243298acf573620c764a1037bd545c9bc (diff) |
thp: fix anon memory statistics with transparent hugepages
Count each transparent hugepage as HPAGE_PMD_NR pages in the LRU
statistics, so the Active(anon) and Inactive(anon) statistics in
/proc/meminfo are correct.
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrea Arcangeli <aarcange@redhat.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.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 650f31eabdb1..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 |
@@ -24,7 +26,7 @@ __add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l, | |||
24 | struct list_head *head) | 26 | struct list_head *head) |
25 | { | 27 | { |
26 | list_add(&page->lru, head); | 28 | list_add(&page->lru, head); |
27 | __inc_zone_state(zone, NR_LRU_BASE + l); | 29 | __mod_zone_page_state(zone, NR_LRU_BASE + l, hpage_nr_pages(page)); |
28 | mem_cgroup_add_lru_list(page, l); | 30 | mem_cgroup_add_lru_list(page, l); |
29 | } | 31 | } |
30 | 32 | ||
@@ -38,7 +40,7 @@ static inline void | |||
38 | 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) |
39 | { | 41 | { |
40 | list_del(&page->lru); | 42 | list_del(&page->lru); |
41 | __dec_zone_state(zone, NR_LRU_BASE + l); | 43 | __mod_zone_page_state(zone, NR_LRU_BASE + l, -hpage_nr_pages(page)); |
42 | mem_cgroup_del_lru_list(page, l); | 44 | mem_cgroup_del_lru_list(page, l); |
43 | } | 45 | } |
44 | 46 | ||
@@ -73,7 +75,7 @@ del_page_from_lru(struct zone *zone, struct page *page) | |||
73 | l += LRU_ACTIVE; | 75 | l += LRU_ACTIVE; |
74 | } | 76 | } |
75 | } | 77 | } |
76 | __dec_zone_state(zone, NR_LRU_BASE + l); | 78 | __mod_zone_page_state(zone, NR_LRU_BASE + l, -hpage_nr_pages(page)); |
77 | mem_cgroup_del_lru_list(page, l); | 79 | mem_cgroup_del_lru_list(page, l); |
78 | } | 80 | } |
79 | 81 | ||