diff options
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r-- | mm/vmscan.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 9789a2c92563..154b37a33731 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -1951,6 +1951,11 @@ unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, | |||
1951 | sc.nodemask = &nm; | 1951 | sc.nodemask = &nm; |
1952 | sc.nr_reclaimed = 0; | 1952 | sc.nr_reclaimed = 0; |
1953 | sc.nr_scanned = 0; | 1953 | sc.nr_scanned = 0; |
1954 | |||
1955 | trace_mm_vmscan_memcg_softlimit_reclaim_begin(0, | ||
1956 | sc.may_writepage, | ||
1957 | sc.gfp_mask); | ||
1958 | |||
1954 | /* | 1959 | /* |
1955 | * NOTE: Although we can get the priority field, using it | 1960 | * NOTE: Although we can get the priority field, using it |
1956 | * here is not a good idea, since it limits the pages we can scan. | 1961 | * here is not a good idea, since it limits the pages we can scan. |
@@ -1959,6 +1964,9 @@ unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, | |||
1959 | * the priority and make it zero. | 1964 | * the priority and make it zero. |
1960 | */ | 1965 | */ |
1961 | shrink_zone(0, zone, &sc); | 1966 | shrink_zone(0, zone, &sc); |
1967 | |||
1968 | trace_mm_vmscan_memcg_softlimit_reclaim_end(sc.nr_reclaimed); | ||
1969 | |||
1962 | return sc.nr_reclaimed; | 1970 | return sc.nr_reclaimed; |
1963 | } | 1971 | } |
1964 | 1972 | ||
@@ -1968,6 +1976,7 @@ unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem_cont, | |||
1968 | unsigned int swappiness) | 1976 | unsigned int swappiness) |
1969 | { | 1977 | { |
1970 | struct zonelist *zonelist; | 1978 | struct zonelist *zonelist; |
1979 | unsigned long nr_reclaimed; | ||
1971 | struct scan_control sc = { | 1980 | struct scan_control sc = { |
1972 | .may_writepage = !laptop_mode, | 1981 | .may_writepage = !laptop_mode, |
1973 | .may_unmap = 1, | 1982 | .may_unmap = 1, |
@@ -1982,7 +1991,16 @@ unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem_cont, | |||
1982 | sc.gfp_mask = (gfp_mask & GFP_RECLAIM_MASK) | | 1991 | sc.gfp_mask = (gfp_mask & GFP_RECLAIM_MASK) | |
1983 | (GFP_HIGHUSER_MOVABLE & ~GFP_RECLAIM_MASK); | 1992 | (GFP_HIGHUSER_MOVABLE & ~GFP_RECLAIM_MASK); |
1984 | zonelist = NODE_DATA(numa_node_id())->node_zonelists; | 1993 | zonelist = NODE_DATA(numa_node_id())->node_zonelists; |
1985 | return do_try_to_free_pages(zonelist, &sc); | 1994 | |
1995 | trace_mm_vmscan_memcg_reclaim_begin(0, | ||
1996 | sc.may_writepage, | ||
1997 | sc.gfp_mask); | ||
1998 | |||
1999 | nr_reclaimed = do_try_to_free_pages(zonelist, &sc); | ||
2000 | |||
2001 | trace_mm_vmscan_memcg_reclaim_end(nr_reclaimed); | ||
2002 | |||
2003 | return nr_reclaimed; | ||
1986 | } | 2004 | } |
1987 | #endif | 2005 | #endif |
1988 | 2006 | ||