Lines Matching full:zone
121 * zone->lock and the zone lru_lock are two of the hottest locks in the kernel.
123 * cachelines. There are very few zone structures in the machine, so space
140 NUMA_INTERLEAVE_HIT, /* interleaver preferred this zone */
431 struct zone { struct
434 /* zone watermarks, access with *_wmark_pages(zone) macros */
443 * wasting several GB of ram we must reserve some of the lower zone argument
469 * spanned_pages is the total pages spanned by the zone, including argument
473 * present_pages is physical pages existing within the zone, which
494 * It is a seqlock because it has to be read outside of zone->lock,
498 * The span_seq lock is declared along with zone->lock because it is
499 * frequently read in proximity to zone->lock. It's good to
519 * of pageblock. Protected by zone->lock. argument
537 /* zone flags, see below */ argument
582 /* Zone statistics */
604 ZONE_BOOSTED_WATERMARK, /* zone recently boosted watermarks. argument
609 static inline unsigned long zone_managed_pages(struct zone *zone) in zone_managed_pages() argument
611 return (unsigned long)atomic_long_read(&zone->managed_pages); in zone_managed_pages()
614 static inline unsigned long zone_cma_pages(struct zone *zone) in zone_cma_pages() argument
617 return zone->cma_pages; in zone_cma_pages()
623 static inline unsigned long zone_end_pfn(const struct zone *zone) in zone_end_pfn() argument
625 return zone->zone_start_pfn + zone->spanned_pages; in zone_end_pfn()
628 static inline bool zone_spans_pfn(const struct zone *zone, unsigned long pfn) in zone_spans_pfn() argument
630 return zone->zone_start_pfn <= pfn && pfn < zone_end_pfn(zone); in zone_spans_pfn()
633 static inline bool zone_is_initialized(struct zone *zone) in zone_is_initialized() argument
635 return zone->initialized; in zone_is_initialized()
638 static inline bool zone_is_empty(struct zone *zone) in zone_is_empty() argument
640 return zone->spanned_pages == 0; in zone_is_empty()
645 * intersection with the given zone
647 static inline bool zone_intersects(struct zone *zone, in zone_intersects() argument
650 if (zone_is_empty(zone)) in zone_intersects()
652 if (start_pfn >= zone_end_pfn(zone) || in zone_intersects()
653 start_pfn + nr_pages <= zone->zone_start_pfn) in zone_intersects()
682 * This struct contains information about a zone in a zonelist. It is stored
686 struct zone *zone; /* Pointer to actual zone */ member
687 int zone_idx; /* zone_idx(zoneref->zone) */
696 * To speed the reading of the zonelist, the zonerefs contain the zone index
700 * zonelist_zone() - Return the struct zone * for an entry in _zonerefs
701 * zonelist_zone_idx() - Return the index of the zone for an entry
727 * per-zone basis.
735 struct zone node_zones[MAX_NR_ZONES];
762 * Nests above zone->lock and zone->span_seqlock
862 void wakeup_kswapd(struct zone *zone, gfp_t gfp_mask, int order,
864 bool __zone_watermark_ok(struct zone *z, unsigned int order, unsigned long mark,
867 bool zone_watermark_ok(struct zone *z, unsigned int order,
870 bool zone_watermark_ok_safe(struct zone *z, unsigned int order,
881 extern void init_currently_empty_zone(struct zone *zone, unsigned long start_pfn,
904 * zone_idx() returns 0 for the ZONE_DMA zone, 1 for the ZONE_NORMAL zone, etc.
906 #define zone_idx(zone) ((zone) - (zone)->zone_pgdat->node_zones) argument
909 * Returns true if a zone has pages managed by the buddy allocator.
911 * populated_zone(). If the whole zone is reserved then we can easily
914 static inline bool managed_zone(struct zone *zone) in managed_zone() argument
916 return zone_managed_pages(zone); in managed_zone()
919 /* Returns true if a zone has memory */
920 static inline bool populated_zone(struct zone *zone) in populated_zone() argument
922 return zone->present_pages; in populated_zone()
926 static inline int zone_to_nid(struct zone *zone) in zone_to_nid() argument
928 return zone->node; in zone_to_nid()
931 static inline void zone_set_nid(struct zone *zone, int nid) in zone_set_nid() argument
933 zone->node = nid; in zone_set_nid()
936 static inline int zone_to_nid(struct zone *zone) in zone_to_nid() argument
941 static inline void zone_set_nid(struct zone *zone, int nid) {} in zone_set_nid() argument
977 * is_highmem - helper function to quickly check if a struct zone is a
978 * highmem zone or not. This is an attempt to keep references
980 * @zone - pointer to struct zone variable
982 static inline int is_highmem(struct zone *zone) in is_highmem() argument
985 return is_highmem_idx(zone_idx(zone)); in is_highmem()
991 /* These two functions are used to setup the per zone pages min values */
1027 extern struct zone *next_zone(struct zone *zone);
1040 * @zone - pointer to struct zone variable
1042 * The user only needs to declare the zone variable, for_each_zone
1045 #define for_each_zone(zone) \ argument
1046 for (zone = (first_online_pgdat())->node_zones; \
1047 zone; \
1048 zone = next_zone(zone))
1050 #define for_each_populated_zone(zone) \ argument
1051 for (zone = (first_online_pgdat())->node_zones; \
1052 zone; \
1053 zone = next_zone(zone)) \
1054 if (!populated_zone(zone)) \
1058 static inline struct zone *zonelist_zone(struct zoneref *zoneref) in zonelist_zone()
1060 return zoneref->zone; in zonelist_zone()
1070 return zone_to_nid(zoneref->zone); in zonelist_node_idx()
1078 …* next_zones_zonelist - Returns the next zone at or below highest_zoneidx within the allowed nodem…
1080 * @highest_zoneidx - The zone index of the highest zone to return
1083 * This function returns the next zone at or below a given zone index that is
1085 * search. The zoneref returned is a cursor that represents the current zone
1099 …* first_zones_zonelist - Returns the first zone at or below highest_zoneidx within the allowed nod…
1100 * @zonelist - The zonelist to search for a suitable zone
1101 * @highest_zoneidx - The zone index of the highest zone to return
1103 * @return - Zoneref pointer for the first suitable zone found (see below)
1105 * This function returns the first zone at or below a given zone index that is
1110 * When no eligible zone is found, zoneref->zone is NULL (zoneref itself is
1123 …elper macro to iterate over valid zones in a zonelist at or below a given zone index and within a …
1124 * @zone - The current zone in the iterator
1127 * @highidx - The zone index of the highest zone to return
1130 * This iterator iterates though all zones at or below a given zone index and
1133 #define for_each_zone_zonelist_nodemask(zone, z, zlist, highidx, nodemask) \ argument
1134 for (z = first_zones_zonelist(zlist, highidx, nodemask), zone = zonelist_zone(z); \
1135 zone; \
1137 zone = zonelist_zone(z))
1139 #define for_next_zone_zonelist_nodemask(zone, z, highidx, nodemask) \ argument
1140 for (zone = z->zone; \
1141 zone; \
1143 zone = zonelist_zone(z))
1147 …ne_zonelist - helper macro to iterate over valid zones in a zonelist at or below a given zone index
1148 * @zone - The current zone in the iterator
1151 * @highidx - The zone index of the highest zone to return
1153 * This iterator iterates though all zones at or below a given zone index.
1155 #define for_each_zone_zonelist(zone, z, zlist, highidx) \ argument
1156 for_each_zone_zonelist_nodemask(zone, z, zlist, highidx, NULL)
1221 /* See declaration of similar field in struct zone */