diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2014-10-09 18:28:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-09 22:25:57 -0400 |
commit | 5705465174686d007473e017b76c4b64b44aa690 (patch) | |
tree | 09d197b925802f7b2b7d96129046eb0d15da60dc /include/linux | |
parent | 7c809968ffa92d41baaa9054e897436480179b20 (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 'include/linux')
-rw-r--r-- | include/linux/mmzone.h | 51 |
1 files changed, 3 insertions, 48 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 318df7051850..48bf12ef6620 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -521,13 +521,13 @@ struct zone { | |||
521 | atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; | 521 | atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; |
522 | } ____cacheline_internodealigned_in_smp; | 522 | } ____cacheline_internodealigned_in_smp; |
523 | 523 | ||
524 | typedef enum { | 524 | enum zone_flags { |
525 | ZONE_RECLAIM_LOCKED, /* prevents concurrent reclaim */ | 525 | ZONE_RECLAIM_LOCKED, /* prevents concurrent reclaim */ |
526 | ZONE_OOM_LOCKED, /* zone is in OOM killer zonelist */ | 526 | ZONE_OOM_LOCKED, /* zone is in OOM killer zonelist */ |
527 | ZONE_CONGESTED, /* zone has many dirty pages backed by | 527 | ZONE_CONGESTED, /* zone has many dirty pages backed by |
528 | * a congested BDI | 528 | * a congested BDI |
529 | */ | 529 | */ |
530 | ZONE_TAIL_LRU_DIRTY, /* reclaim scanning has recently found | 530 | ZONE_DIRTY, /* reclaim scanning has recently found |
531 | * many dirty file pages at the tail | 531 | * many dirty file pages at the tail |
532 | * of the LRU. | 532 | * of the LRU. |
533 | */ | 533 | */ |
@@ -535,52 +535,7 @@ typedef enum { | |||
535 | * many pages under writeback | 535 | * many pages under writeback |
536 | */ | 536 | */ |
537 | ZONE_FAIR_DEPLETED, /* fair zone policy batch depleted */ | 537 | ZONE_FAIR_DEPLETED, /* fair zone policy batch depleted */ |
538 | } zone_flags_t; | 538 | }; |
539 | |||
540 | static inline void zone_set_flag(struct zone *zone, zone_flags_t flag) | ||
541 | { | ||
542 | set_bit(flag, &zone->flags); | ||
543 | } | ||
544 | |||
545 | static inline int zone_test_and_set_flag(struct zone *zone, zone_flags_t flag) | ||
546 | { | ||
547 | return test_and_set_bit(flag, &zone->flags); | ||
548 | } | ||
549 | |||
550 | static inline void zone_clear_flag(struct zone *zone, zone_flags_t flag) | ||
551 | { | ||
552 | clear_bit(flag, &zone->flags); | ||
553 | } | ||
554 | |||
555 | static inline int zone_is_reclaim_congested(const struct zone *zone) | ||
556 | { | ||
557 | return test_bit(ZONE_CONGESTED, &zone->flags); | ||
558 | } | ||
559 | |||
560 | static inline int zone_is_reclaim_dirty(const struct zone *zone) | ||
561 | { | ||
562 | return test_bit(ZONE_TAIL_LRU_DIRTY, &zone->flags); | ||
563 | } | ||
564 | |||
565 | static inline int zone_is_reclaim_writeback(const struct zone *zone) | ||
566 | { | ||
567 | return test_bit(ZONE_WRITEBACK, &zone->flags); | ||
568 | } | ||
569 | |||
570 | static inline int zone_is_reclaim_locked(const struct zone *zone) | ||
571 | { | ||
572 | return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags); | ||
573 | } | ||
574 | |||
575 | static inline int zone_is_fair_depleted(const struct zone *zone) | ||
576 | { | ||
577 | return test_bit(ZONE_FAIR_DEPLETED, &zone->flags); | ||
578 | } | ||
579 | |||
580 | static inline int zone_is_oom_locked(const struct zone *zone) | ||
581 | { | ||
582 | return test_bit(ZONE_OOM_LOCKED, &zone->flags); | ||
583 | } | ||
584 | 539 | ||
585 | static inline unsigned long zone_end_pfn(const struct zone *zone) | 540 | static inline unsigned long zone_end_pfn(const struct zone *zone) |
586 | { | 541 | { |