aboutsummaryrefslogtreecommitdiffstats
path: root/mm/huge_memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/huge_memory.c')
-rw-r--r--mm/huge_memory.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 892d8a17a7e5..f4f6041176a4 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1143,6 +1143,7 @@ static void __split_huge_page_refcount(struct page *page)
1143 int i; 1143 int i;
1144 unsigned long head_index = page->index; 1144 unsigned long head_index = page->index;
1145 struct zone *zone = page_zone(page); 1145 struct zone *zone = page_zone(page);
1146 int zonestat;
1146 1147
1147 /* prevent PageLRU to go away from under us, and freeze lru stats */ 1148 /* prevent PageLRU to go away from under us, and freeze lru stats */
1148 spin_lock_irq(&zone->lru_lock); 1149 spin_lock_irq(&zone->lru_lock);
@@ -1207,6 +1208,15 @@ static void __split_huge_page_refcount(struct page *page)
1207 __dec_zone_page_state(page, NR_ANON_TRANSPARENT_HUGEPAGES); 1208 __dec_zone_page_state(page, NR_ANON_TRANSPARENT_HUGEPAGES);
1208 __mod_zone_page_state(zone, NR_ANON_PAGES, HPAGE_PMD_NR); 1209 __mod_zone_page_state(zone, NR_ANON_PAGES, HPAGE_PMD_NR);
1209 1210
1211 /*
1212 * A hugepage counts for HPAGE_PMD_NR pages on the LRU statistics,
1213 * so adjust those appropriately if this page is on the LRU.
1214 */
1215 if (PageLRU(page)) {
1216 zonestat = NR_LRU_BASE + page_lru(page);
1217 __mod_zone_page_state(zone, zonestat, -(HPAGE_PMD_NR-1));
1218 }
1219
1210 ClearPageCompound(page); 1220 ClearPageCompound(page);
1211 compound_unlock(page); 1221 compound_unlock(page);
1212 spin_unlock_irq(&zone->lru_lock); 1222 spin_unlock_irq(&zone->lru_lock);