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

committed by
Linus Torvalds

parent
7c809968ff
commit
5705465174
@@ -1614,8 +1614,8 @@ again:
|
||||
|
||||
__mod_zone_page_state(zone, NR_ALLOC_BATCH, -(1 << order));
|
||||
if (atomic_long_read(&zone->vm_stat[NR_ALLOC_BATCH]) <= 0 &&
|
||||
!zone_is_fair_depleted(zone))
|
||||
zone_set_flag(zone, ZONE_FAIR_DEPLETED);
|
||||
!test_bit(ZONE_FAIR_DEPLETED, &zone->flags))
|
||||
set_bit(ZONE_FAIR_DEPLETED, &zone->flags);
|
||||
|
||||
__count_zone_vm_events(PGALLOC, zone, 1 << order);
|
||||
zone_statistics(preferred_zone, zone, gfp_flags);
|
||||
@@ -1935,7 +1935,7 @@ static void reset_alloc_batches(struct zone *preferred_zone)
|
||||
mod_zone_page_state(zone, NR_ALLOC_BATCH,
|
||||
high_wmark_pages(zone) - low_wmark_pages(zone) -
|
||||
atomic_long_read(&zone->vm_stat[NR_ALLOC_BATCH]));
|
||||
zone_clear_flag(zone, ZONE_FAIR_DEPLETED);
|
||||
clear_bit(ZONE_FAIR_DEPLETED, &zone->flags);
|
||||
} while (zone++ != preferred_zone);
|
||||
}
|
||||
|
||||
@@ -1986,7 +1986,7 @@ zonelist_scan:
|
||||
if (alloc_flags & ALLOC_FAIR) {
|
||||
if (!zone_local(preferred_zone, zone))
|
||||
break;
|
||||
if (zone_is_fair_depleted(zone)) {
|
||||
if (test_bit(ZONE_FAIR_DEPLETED, &zone->flags)) {
|
||||
nr_fair_skipped++;
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user