aboutsummaryrefslogtreecommitdiffstats
path: root/mm/migrate.c
diff options
context:
space:
mode:
authorMel Gorman <mgorman@techsingularity.net>2016-07-28 18:46:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-28 19:07:41 -0400
commit11fb998986a72aa7e997d96d63d52582a01228c5 (patch)
treefd9db095081c4fe2212db7de2757bfdf4645dc04 /mm/migrate.c
parent4b9d0fab7166c9323f06d708518a35cf3a90426c (diff)
mm: move most file-based accounting to the node
There are now a number of accounting oddities such as mapped file pages being accounted for on the node while the total number of file pages are accounted on the zone. This can be coped with to some extent but it's confusing so this patch moves the relevant file-based accounted. Due to throttling logic in the page allocator for reliable OOM detection, it is still necessary to track dirty and writeback pages on a per-zone basis. [mgorman@techsingularity.net: fix NR_ZONE_WRITE_PENDING accounting] Link: http://lkml.kernel.org/r/1468404004-5085-5-git-send-email-mgorman@techsingularity.net Link: http://lkml.kernel.org/r/1467970510-21195-20-git-send-email-mgorman@techsingularity.net Signed-off-by: Mel Gorman <mgorman@techsingularity.net> Acked-by: Vlastimil Babka <vbabka@suse.cz> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Hillf Danton <hillf.zj@alibaba-inc.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Rik van Riel <riel@surriel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/migrate.c')
-rw-r--r--mm/migrate.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index fba770c54d84..ed0268268e93 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -505,15 +505,17 @@ int migrate_page_move_mapping(struct address_space *mapping,
505 * are mapped to swap space. 505 * are mapped to swap space.
506 */ 506 */
507 if (newzone != oldzone) { 507 if (newzone != oldzone) {
508 __dec_zone_state(oldzone, NR_FILE_PAGES); 508 __dec_node_state(oldzone->zone_pgdat, NR_FILE_PAGES);
509 __inc_zone_state(newzone, NR_FILE_PAGES); 509 __inc_node_state(newzone->zone_pgdat, NR_FILE_PAGES);
510 if (PageSwapBacked(page) && !PageSwapCache(page)) { 510 if (PageSwapBacked(page) && !PageSwapCache(page)) {
511 __dec_zone_state(oldzone, NR_SHMEM); 511 __dec_node_state(oldzone->zone_pgdat, NR_SHMEM);
512 __inc_zone_state(newzone, NR_SHMEM); 512 __inc_node_state(newzone->zone_pgdat, NR_SHMEM);
513 } 513 }
514 if (dirty && mapping_cap_account_dirty(mapping)) { 514 if (dirty && mapping_cap_account_dirty(mapping)) {
515 __dec_zone_state(oldzone, NR_FILE_DIRTY); 515 __dec_node_state(oldzone->zone_pgdat, NR_FILE_DIRTY);
516 __inc_zone_state(newzone, NR_FILE_DIRTY); 516 __dec_zone_state(oldzone, NR_ZONE_WRITE_PENDING);
517 __inc_node_state(newzone->zone_pgdat, NR_FILE_DIRTY);
518 __inc_zone_state(newzone, NR_ZONE_WRITE_PENDING);
517 } 519 }
518 } 520 }
519 local_irq_enable(); 521 local_irq_enable();