diff options
-rw-r--r-- | include/linux/vm_event_item.h | 2 | ||||
-rw-r--r-- | mm/page_alloc.c | 17 | ||||
-rw-r--r-- | mm/vmstat.c | 2 |
3 files changed, 2 insertions, 19 deletions
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h index 57f7b1091511..ede4ddd46695 100644 --- a/include/linux/vm_event_item.h +++ b/include/linux/vm_event_item.h | |||
@@ -52,7 +52,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | |||
52 | UNEVICTABLE_PGMUNLOCKED, | 52 | UNEVICTABLE_PGMUNLOCKED, |
53 | UNEVICTABLE_PGCLEARED, /* on COW, page truncate */ | 53 | UNEVICTABLE_PGCLEARED, /* on COW, page truncate */ |
54 | UNEVICTABLE_PGSTRANDED, /* unable to isolate on unlock */ | 54 | UNEVICTABLE_PGSTRANDED, /* unable to isolate on unlock */ |
55 | UNEVICTABLE_MLOCKFREED, | 55 | UNEVICTABLE_MLOCKFREED, /* no longer useful: always zero */ |
56 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 56 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
57 | THP_FAULT_ALLOC, | 57 | THP_FAULT_ALLOC, |
58 | THP_FAULT_FALLBACK, | 58 | THP_FAULT_FALLBACK, |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 00750bc08a3a..dbb53866c3aa 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -598,17 +598,6 @@ out: | |||
598 | zone->free_area[order].nr_free++; | 598 | zone->free_area[order].nr_free++; |
599 | } | 599 | } |
600 | 600 | ||
601 | /* | ||
602 | * free_page_mlock() -- clean up attempts to free and mlocked() page. | ||
603 | * Page should not be on lru, so no need to fix that up. | ||
604 | * free_pages_check() will verify... | ||
605 | */ | ||
606 | static inline void free_page_mlock(struct page *page) | ||
607 | { | ||
608 | __dec_zone_page_state(page, NR_MLOCK); | ||
609 | __count_vm_event(UNEVICTABLE_MLOCKFREED); | ||
610 | } | ||
611 | |||
612 | static inline int free_pages_check(struct page *page) | 601 | static inline int free_pages_check(struct page *page) |
613 | { | 602 | { |
614 | if (unlikely(page_mapcount(page) | | 603 | if (unlikely(page_mapcount(page) | |
@@ -728,15 +717,12 @@ static bool free_pages_prepare(struct page *page, unsigned int order) | |||
728 | static void __free_pages_ok(struct page *page, unsigned int order) | 717 | static void __free_pages_ok(struct page *page, unsigned int order) |
729 | { | 718 | { |
730 | unsigned long flags; | 719 | unsigned long flags; |
731 | int wasMlocked = __TestClearPageMlocked(page); | ||
732 | int migratetype; | 720 | int migratetype; |
733 | 721 | ||
734 | if (!free_pages_prepare(page, order)) | 722 | if (!free_pages_prepare(page, order)) |
735 | return; | 723 | return; |
736 | 724 | ||
737 | local_irq_save(flags); | 725 | local_irq_save(flags); |
738 | if (unlikely(wasMlocked)) | ||
739 | free_page_mlock(page); | ||
740 | __count_vm_events(PGFREE, 1 << order); | 726 | __count_vm_events(PGFREE, 1 << order); |
741 | migratetype = get_pageblock_migratetype(page); | 727 | migratetype = get_pageblock_migratetype(page); |
742 | set_freepage_migratetype(page, migratetype); | 728 | set_freepage_migratetype(page, migratetype); |
@@ -1310,7 +1296,6 @@ void free_hot_cold_page(struct page *page, int cold) | |||
1310 | struct per_cpu_pages *pcp; | 1296 | struct per_cpu_pages *pcp; |
1311 | unsigned long flags; | 1297 | unsigned long flags; |
1312 | int migratetype; | 1298 | int migratetype; |
1313 | int wasMlocked = __TestClearPageMlocked(page); | ||
1314 | 1299 | ||
1315 | if (!free_pages_prepare(page, 0)) | 1300 | if (!free_pages_prepare(page, 0)) |
1316 | return; | 1301 | return; |
@@ -1318,8 +1303,6 @@ void free_hot_cold_page(struct page *page, int cold) | |||
1318 | migratetype = get_pageblock_migratetype(page); | 1303 | migratetype = get_pageblock_migratetype(page); |
1319 | set_freepage_migratetype(page, migratetype); | 1304 | set_freepage_migratetype(page, migratetype); |
1320 | local_irq_save(flags); | 1305 | local_irq_save(flags); |
1321 | if (unlikely(wasMlocked)) | ||
1322 | free_page_mlock(page); | ||
1323 | __count_vm_event(PGFREE); | 1306 | __count_vm_event(PGFREE); |
1324 | 1307 | ||
1325 | /* | 1308 | /* |
diff --git a/mm/vmstat.c b/mm/vmstat.c index acbd85c983e6..05e3a9913744 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c | |||
@@ -782,7 +782,7 @@ const char * const vmstat_text[] = { | |||
782 | "unevictable_pgs_munlocked", | 782 | "unevictable_pgs_munlocked", |
783 | "unevictable_pgs_cleared", | 783 | "unevictable_pgs_cleared", |
784 | "unevictable_pgs_stranded", | 784 | "unevictable_pgs_stranded", |
785 | "unevictable_pgs_mlockfreed", | 785 | "unevictable_pgs_mlockfreed", /* no longer useful: always zero */ |
786 | 786 | ||
787 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 787 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
788 | "thp_fault_alloc", | 788 | "thp_fault_alloc", |