Commit 2a6e3ebe authored by Cody P Schafer's avatar Cody P Schafer Committed by Linus Torvalds

mm: add zone_is_empty() and zone_is_initialized()

Factoring out these 2 checks makes it more clear what we are actually
checking for.
Signed-off-by: default avatarCody P Schafer <cody@linux.vnet.ibm.com>
Cc: David Hansen <dave@linux.vnet.ibm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 108bcc96
...@@ -537,6 +537,16 @@ static inline bool zone_spans_pfn(const struct zone *zone, unsigned long pfn) ...@@ -537,6 +537,16 @@ static inline bool zone_spans_pfn(const struct zone *zone, unsigned long pfn)
return zone->zone_start_pfn <= pfn && pfn < zone_end_pfn(zone); return zone->zone_start_pfn <= pfn && pfn < zone_end_pfn(zone);
} }
static inline bool zone_is_initialized(struct zone *zone)
{
return !!zone->wait_table;
}
static inline bool zone_is_empty(struct zone *zone)
{
return zone->spanned_pages == 0;
}
/* /*
* The "priority" of VM scanning is how much of the queues we will scan in one * The "priority" of VM scanning is how much of the queues we will scan in one
* go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment