diff options
author | Hugh Dickins <hughd@google.com> | 2012-05-29 18:06:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-29 19:22:25 -0400 |
commit | 89abfab133ef1f5902abafb744df72793213ac19 (patch) | |
tree | 29df29e2a34a0af3649417d2e430480c7e7e5fa1 /mm/swap.c | |
parent | c3c787e8c38557ccf44c670d73aebe630a2b1479 (diff) |
mm/memcg: move reclaim_stat into lruvec
With mem_cgroup_disabled() now explicit, it becomes clear that the
zone_reclaim_stat structure actually belongs in lruvec, per-zone when
memcg is disabled but per-memcg per-zone when it's enabled.
We can delete mem_cgroup_get_reclaim_stat(), and change
update_page_reclaim_stat() to update just the one set of stats, the one
which get_scan_count() will actually use.
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Reviewed-by: Minchan Kim <minchan@kernel.org>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Cc: Glauber Costa <glommer@parallels.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/swap.c')
-rw-r--r-- | mm/swap.c | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -312,21 +312,15 @@ void rotate_reclaimable_page(struct page *page) | |||
312 | static void update_page_reclaim_stat(struct zone *zone, struct page *page, | 312 | static 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 | ||
332 | static void __activate_page(struct page *page, void *arg) | 326 | static void __activate_page(struct page *page, void *arg) |