diff options
author | Kirill Tkhai <ktkhai@virtuozzo.com> | 2019-05-13 20:16:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-14 12:47:45 -0400 |
commit | 886cf1901db962cee5f8b82b9b260079a5e8a4eb (patch) | |
tree | 53edc7213da3403ed7b201d08e448719c352bc19 /Documentation/trace | |
parent | 63931eb97508cd67515dbcc049defaebd7b1fcd0 (diff) |
mm: move recent_rotated pages calculation to shrink_inactive_list()
Patch series "mm: Generalize putback functions"]
putback_inactive_pages() and move_active_pages_to_lru() are almost
similar, so this patchset merges them ina single function.
This patch (of 4):
The patch moves the calculation from putback_inactive_pages() to
shrink_inactive_list(). This makes putback_inactive_pages() looking more
similar to move_active_pages_to_lru().
To do that, we account activated pages in reclaim_stat::nr_activate.
Since a page may change its LRU type from anon to file cache inside
shrink_page_list() (see ClearPageSwapBacked()), we have to account pages
for the both types. So, nr_activate becomes an array.
Previously we used nr_activate to account PGACTIVATE events, but now we
account them into pgactivate variable (since they are about number of
pages in general, not about sum of hpage_nr_pages).
Link: http://lkml.kernel.org/r/155290127956.31489.3393586616054413298.stgit@localhost.localdomain
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/trace')
-rw-r--r-- | Documentation/trace/postprocess/trace-vmscan-postprocess.pl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Documentation/trace/postprocess/trace-vmscan-postprocess.pl b/Documentation/trace/postprocess/trace-vmscan-postprocess.pl index 66bfd8396877..995da15b16ca 100644 --- a/Documentation/trace/postprocess/trace-vmscan-postprocess.pl +++ b/Documentation/trace/postprocess/trace-vmscan-postprocess.pl | |||
@@ -113,7 +113,7 @@ my $regex_kswapd_wake_default = 'nid=([0-9]*) order=([0-9]*)'; | |||
113 | my $regex_kswapd_sleep_default = 'nid=([0-9]*)'; | 113 | my $regex_kswapd_sleep_default = 'nid=([0-9]*)'; |
114 | my $regex_wakeup_kswapd_default = 'nid=([0-9]*) zid=([0-9]*) order=([0-9]*) gfp_flags=([A-Z_|]*)'; | 114 | my $regex_wakeup_kswapd_default = 'nid=([0-9]*) zid=([0-9]*) order=([0-9]*) gfp_flags=([A-Z_|]*)'; |
115 | my $regex_lru_isolate_default = 'isolate_mode=([0-9]*) classzone_idx=([0-9]*) order=([0-9]*) nr_requested=([0-9]*) nr_scanned=([0-9]*) nr_skipped=([0-9]*) nr_taken=([0-9]*) lru=([a-z_]*)'; | 115 | my $regex_lru_isolate_default = 'isolate_mode=([0-9]*) classzone_idx=([0-9]*) order=([0-9]*) nr_requested=([0-9]*) nr_scanned=([0-9]*) nr_skipped=([0-9]*) nr_taken=([0-9]*) lru=([a-z_]*)'; |
116 | my $regex_lru_shrink_inactive_default = 'nid=([0-9]*) nr_scanned=([0-9]*) nr_reclaimed=([0-9]*) nr_dirty=([0-9]*) nr_writeback=([0-9]*) nr_congested=([0-9]*) nr_immediate=([0-9]*) nr_activate=([0-9]*) nr_ref_keep=([0-9]*) nr_unmap_fail=([0-9]*) priority=([0-9]*) flags=([A-Z_|]*)'; | 116 | my $regex_lru_shrink_inactive_default = 'nid=([0-9]*) nr_scanned=([0-9]*) nr_reclaimed=([0-9]*) nr_dirty=([0-9]*) nr_writeback=([0-9]*) nr_congested=([0-9]*) nr_immediate=([0-9]*) nr_activate_anon=([0-9]*) nr_activate_file=([0-9]*) nr_ref_keep=([0-9]*) nr_unmap_fail=([0-9]*) priority=([0-9]*) flags=([A-Z_|]*)'; |
117 | my $regex_lru_shrink_active_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_rotated=([0-9]*) priority=([0-9]*)'; | 117 | my $regex_lru_shrink_active_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_rotated=([0-9]*) priority=([0-9]*)'; |
118 | my $regex_writepage_default = 'page=([0-9a-f]*) pfn=([0-9]*) flags=([A-Z_|]*)'; | 118 | my $regex_writepage_default = 'page=([0-9a-f]*) pfn=([0-9]*) flags=([A-Z_|]*)'; |
119 | 119 | ||
@@ -212,7 +212,8 @@ $regex_lru_shrink_inactive = generate_traceevent_regex( | |||
212 | "vmscan/mm_vmscan_lru_shrink_inactive", | 212 | "vmscan/mm_vmscan_lru_shrink_inactive", |
213 | $regex_lru_shrink_inactive_default, | 213 | $regex_lru_shrink_inactive_default, |
214 | "nid", "nr_scanned", "nr_reclaimed", "nr_dirty", "nr_writeback", | 214 | "nid", "nr_scanned", "nr_reclaimed", "nr_dirty", "nr_writeback", |
215 | "nr_congested", "nr_immediate", "nr_activate", "nr_ref_keep", | 215 | "nr_congested", "nr_immediate", "nr_activate_anon", |
216 | "nr_activate_file", "nr_ref_keep", | ||
216 | "nr_unmap_fail", "priority", "flags"); | 217 | "nr_unmap_fail", "priority", "flags"); |
217 | $regex_lru_shrink_active = generate_traceevent_regex( | 218 | $regex_lru_shrink_active = generate_traceevent_regex( |
218 | "vmscan/mm_vmscan_lru_shrink_active", | 219 | "vmscan/mm_vmscan_lru_shrink_active", |
@@ -407,7 +408,7 @@ EVENT_PROCESS: | |||
407 | } | 408 | } |
408 | 409 | ||
409 | my $nr_reclaimed = $3; | 410 | my $nr_reclaimed = $3; |
410 | my $flags = $12; | 411 | my $flags = $13; |
411 | my $file = 0; | 412 | my $file = 0; |
412 | if ($flags =~ /RECLAIM_WB_FILE/) { | 413 | if ($flags =~ /RECLAIM_WB_FILE/) { |
413 | $file = 1; | 414 | $file = 1; |