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>
此提交包含在:
@@ -565,7 +565,7 @@ bool oom_zonelist_trylock(struct zonelist *zonelist, gfp_t gfp_mask)
|
||||
|
||||
spin_lock(&zone_scan_lock);
|
||||
for_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask))
|
||||
if (zone_is_oom_locked(zone)) {
|
||||
if (test_bit(ZONE_OOM_LOCKED, &zone->flags)) {
|
||||
ret = false;
|
||||
goto out;
|
||||
}
|
||||
@@ -575,7 +575,7 @@ bool oom_zonelist_trylock(struct zonelist *zonelist, gfp_t gfp_mask)
|
||||
* call to oom_zonelist_trylock() doesn't succeed when it shouldn't.
|
||||
*/
|
||||
for_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask))
|
||||
zone_set_flag(zone, ZONE_OOM_LOCKED);
|
||||
set_bit(ZONE_OOM_LOCKED, &zone->flags);
|
||||
|
||||
out:
|
||||
spin_unlock(&zone_scan_lock);
|
||||
@@ -594,7 +594,7 @@ void oom_zonelist_unlock(struct zonelist *zonelist, gfp_t gfp_mask)
|
||||
|
||||
spin_lock(&zone_scan_lock);
|
||||
for_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask))
|
||||
zone_clear_flag(zone, ZONE_OOM_LOCKED);
|
||||
clear_bit(ZONE_OOM_LOCKED, &zone->flags);
|
||||
spin_unlock(&zone_scan_lock);
|
||||
}
|
||||
|
||||
|
新增問題並參考
封鎖使用者