aboutsummaryrefslogtreecommitdiffstats
path: root/mm/swap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/swap.c')
-rw-r--r--mm/swap.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/mm/swap.c b/mm/swap.c
index 6fdd72ec15b0..0503ad705e7c 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -312,21 +312,15 @@ void rotate_reclaimable_page(struct page *page)
312static void update_page_reclaim_stat(struct zone *zone, struct page *page, 312static void update_page_reclaim_stat(struct zone *zone, struct page *page,
313 int file, int rotated) 313 int file, int rotated)
314{ 314{
315 struct zone_reclaim_stat *reclaim_stat = &zone->reclaim_stat; 315 struct zone_reclaim_stat *reclaim_stat;
316 struct zone_reclaim_stat *memcg_reclaim_stat;
317 316
318 memcg_reclaim_stat = mem_cgroup_get_reclaim_stat_from_page(page); 317 reclaim_stat = mem_cgroup_get_reclaim_stat_from_page(page);
318 if (!reclaim_stat)
319 reclaim_stat = &zone->lruvec.reclaim_stat;
319 320
320 reclaim_stat->recent_scanned[file]++; 321 reclaim_stat->recent_scanned[file]++;
321 if (rotated) 322 if (rotated)
322 reclaim_stat->recent_rotated[file]++; 323 reclaim_stat->recent_rotated[file]++;
323
324 if (!memcg_reclaim_stat)
325 return;
326
327 memcg_reclaim_stat->recent_scanned[file]++;
328 if (rotated)
329 memcg_reclaim_stat->recent_rotated[file]++;
330} 324}
331 325
332static void __activate_page(struct page *page, void *arg) 326static void __activate_page(struct page *page, void *arg)