aboutsummaryrefslogtreecommitdiffstats
path: root/mm/oom_kill.c
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2014-10-09 18:28:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-09 22:25:57 -0400
commit5705465174686d007473e017b76c4b64b44aa690 (patch)
tree09d197b925802f7b2b7d96129046eb0d15da60dc /mm/oom_kill.c
parent7c809968ffa92d41baaa9054e897436480179b20 (diff)
mm: clean up zone flags
Page reclaim tests zone_is_reclaim_dirty(), but the site that actually sets this state does zone_set_flag(zone, ZONE_TAIL_LRU_DIRTY), sending the reader through layers indirection just to track down a simple bit. Remove all zone flag wrappers and just use bitops against zone->flags directly. It's just as readable and the lines are barely any longer. Also rename ZONE_TAIL_LRU_DIRTY to ZONE_DIRTY to match ZONE_WRITEBACK, and remove the zone_flags_t typedef. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: David Rientjes <rientjes@google.com> Acked-by: Mel Gorman <mgorman@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/oom_kill.c')
-rw-r--r--mm/oom_kill.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 1e11df8fa7ec..bbf405a3a18f 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -565,7 +565,7 @@ bool oom_zonelist_trylock(struct zonelist *zonelist, gfp_t gfp_mask)
565 565
566 spin_lock(&zone_scan_lock); 566 spin_lock(&zone_scan_lock);
567 for_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask)) 567 for_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask))
568 if (zone_is_oom_locked(zone)) { 568 if (test_bit(ZONE_OOM_LOCKED, &zone->flags)) {
569 ret = false; 569 ret = false;
570 goto out; 570 goto out;
571 } 571 }
@@ -575,7 +575,7 @@ bool oom_zonelist_trylock(struct zonelist *zonelist, gfp_t gfp_mask)
575 * call to oom_zonelist_trylock() doesn't succeed when it shouldn't. 575 * call to oom_zonelist_trylock() doesn't succeed when it shouldn't.
576 */ 576 */
577 for_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask)) 577 for_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask))
578 zone_set_flag(zone, ZONE_OOM_LOCKED); 578 set_bit(ZONE_OOM_LOCKED, &zone->flags);
579 579
580out: 580out:
581 spin_unlock(&zone_scan_lock); 581 spin_unlock(&zone_scan_lock);
@@ -594,7 +594,7 @@ void oom_zonelist_unlock(struct zonelist *zonelist, gfp_t gfp_mask)
594 594
595 spin_lock(&zone_scan_lock); 595 spin_lock(&zone_scan_lock);
596 for_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask)) 596 for_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask))
597 zone_clear_flag(zone, ZONE_OOM_LOCKED); 597 clear_bit(ZONE_OOM_LOCKED, &zone->flags);
598 spin_unlock(&zone_scan_lock); 598 spin_unlock(&zone_scan_lock);
599} 599}
600 600