aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/mlock.c')
-rw-r--r--mm/mlock.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mm/mlock.c b/mm/mlock.c
index 145a4258ddbc..cdbed8aaa426 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -190,10 +190,13 @@ unsigned int munlock_vma_page(struct page *page)
190 */ 190 */
191 spin_lock_irq(zone_lru_lock(zone)); 191 spin_lock_irq(zone_lru_lock(zone));
192 192
193 nr_pages = hpage_nr_pages(page); 193 if (!TestClearPageMlocked(page)) {
194 if (!TestClearPageMlocked(page)) 194 /* Potentially, PTE-mapped THP: do not skip the rest PTEs */
195 nr_pages = 1;
195 goto unlock_out; 196 goto unlock_out;
197 }
196 198
199 nr_pages = hpage_nr_pages(page);
197 __mod_zone_page_state(zone, NR_MLOCK, -nr_pages); 200 __mod_zone_page_state(zone, NR_MLOCK, -nr_pages);
198 201
199 if (__munlock_isolate_lru_page(page, true)) { 202 if (__munlock_isolate_lru_page(page, true)) {