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>
This commit is contained in:

committed by
Linus Torvalds

parent
63931eb975
commit
886cf1901d
@@ -359,7 +359,8 @@ TRACE_EVENT(mm_vmscan_lru_shrink_inactive,
|
||||
__field(unsigned long, nr_writeback)
|
||||
__field(unsigned long, nr_congested)
|
||||
__field(unsigned long, nr_immediate)
|
||||
__field(unsigned long, nr_activate)
|
||||
__field(unsigned int, nr_activate0)
|
||||
__field(unsigned int, nr_activate1)
|
||||
__field(unsigned long, nr_ref_keep)
|
||||
__field(unsigned long, nr_unmap_fail)
|
||||
__field(int, priority)
|
||||
@@ -374,20 +375,22 @@ TRACE_EVENT(mm_vmscan_lru_shrink_inactive,
|
||||
__entry->nr_writeback = stat->nr_writeback;
|
||||
__entry->nr_congested = stat->nr_congested;
|
||||
__entry->nr_immediate = stat->nr_immediate;
|
||||
__entry->nr_activate = stat->nr_activate;
|
||||
__entry->nr_activate0 = stat->nr_activate[0];
|
||||
__entry->nr_activate1 = stat->nr_activate[1];
|
||||
__entry->nr_ref_keep = stat->nr_ref_keep;
|
||||
__entry->nr_unmap_fail = stat->nr_unmap_fail;
|
||||
__entry->priority = priority;
|
||||
__entry->reclaim_flags = trace_shrink_flags(file);
|
||||
),
|
||||
|
||||
TP_printk("nid=%d nr_scanned=%ld nr_reclaimed=%ld nr_dirty=%ld nr_writeback=%ld nr_congested=%ld nr_immediate=%ld nr_activate=%ld nr_ref_keep=%ld nr_unmap_fail=%ld priority=%d flags=%s",
|
||||
TP_printk("nid=%d nr_scanned=%ld nr_reclaimed=%ld nr_dirty=%ld nr_writeback=%ld nr_congested=%ld nr_immediate=%ld nr_activate_anon=%d nr_activate_file=%d nr_ref_keep=%ld nr_unmap_fail=%ld priority=%d flags=%s",
|
||||
__entry->nid,
|
||||
__entry->nr_scanned, __entry->nr_reclaimed,
|
||||
__entry->nr_dirty, __entry->nr_writeback,
|
||||
__entry->nr_congested, __entry->nr_immediate,
|
||||
__entry->nr_activate, __entry->nr_ref_keep,
|
||||
__entry->nr_unmap_fail, __entry->priority,
|
||||
__entry->nr_activate0, __entry->nr_activate1,
|
||||
__entry->nr_ref_keep, __entry->nr_unmap_fail,
|
||||
__entry->priority,
|
||||
show_reclaim_flags(__entry->reclaim_flags))
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user