aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/internal.h3
-rw-r--r--mm/mlock.c9
2 files changed, 8 insertions, 4 deletions
diff --git a/mm/internal.h b/mm/internal.h
index f5f295fe11e1..a4fa284f6bc2 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -180,7 +180,8 @@ static inline int mlocked_vma_newpage(struct vm_area_struct *vma,
180 return 0; 180 return 0;
181 181
182 if (!TestSetPageMlocked(page)) { 182 if (!TestSetPageMlocked(page)) {
183 inc_zone_page_state(page, NR_MLOCK); 183 mod_zone_page_state(page_zone(page), NR_MLOCK,
184 hpage_nr_pages(page));
184 count_vm_event(UNEVICTABLE_PGMLOCKED); 185 count_vm_event(UNEVICTABLE_PGMLOCKED);
185 } 186 }
186 return 1; 187 return 1;
diff --git a/mm/mlock.c b/mm/mlock.c
index de7321592897..f0b9ce572fc7 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -56,7 +56,8 @@ void clear_page_mlock(struct page *page)
56 if (!TestClearPageMlocked(page)) 56 if (!TestClearPageMlocked(page))
57 return; 57 return;
58 58
59 dec_zone_page_state(page, NR_MLOCK); 59 mod_zone_page_state(page_zone(page), NR_MLOCK,
60 -hpage_nr_pages(page));
60 count_vm_event(UNEVICTABLE_PGCLEARED); 61 count_vm_event(UNEVICTABLE_PGCLEARED);
61 if (!isolate_lru_page(page)) { 62 if (!isolate_lru_page(page)) {
62 putback_lru_page(page); 63 putback_lru_page(page);
@@ -78,7 +79,8 @@ void mlock_vma_page(struct page *page)
78 BUG_ON(!PageLocked(page)); 79 BUG_ON(!PageLocked(page));
79 80
80 if (!TestSetPageMlocked(page)) { 81 if (!TestSetPageMlocked(page)) {
81 inc_zone_page_state(page, NR_MLOCK); 82 mod_zone_page_state(page_zone(page), NR_MLOCK,
83 hpage_nr_pages(page));
82 count_vm_event(UNEVICTABLE_PGMLOCKED); 84 count_vm_event(UNEVICTABLE_PGMLOCKED);
83 if (!isolate_lru_page(page)) 85 if (!isolate_lru_page(page))
84 putback_lru_page(page); 86 putback_lru_page(page);
@@ -105,7 +107,8 @@ void munlock_vma_page(struct page *page)
105 BUG_ON(!PageLocked(page)); 107 BUG_ON(!PageLocked(page));
106 108
107 if (TestClearPageMlocked(page)) { 109 if (TestClearPageMlocked(page)) {
108 dec_zone_page_state(page, NR_MLOCK); 110 mod_zone_page_state(page_zone(page), NR_MLOCK,
111 -hpage_nr_pages(page));
109 if (!isolate_lru_page(page)) { 112 if (!isolate_lru_page(page)) {
110 int ret = SWAP_AGAIN; 113 int ret = SWAP_AGAIN;
111 114