Lines Matching full:zone
116 * zone->lock and the zone lru_lock are two of the hottest locks in the kernel.
118 * cachelines. There are very few zone structures in the machine, so space
135 NUMA_INTERLEAVE_HIT, /* interleaver preferred this zone */
448 struct zone { struct
451 /* zone watermarks, access with *_wmark_pages(zone) macros */
460 * wasting several GB of ram we must reserve some of the lower zone argument
486 * spanned_pages is the total pages spanned by the zone, including argument
490 * present_pages is physical pages existing within the zone, which
508 * It is a seqlock because it has to be read outside of zone->lock,
512 * The span_seq lock is declared along with zone->lock because it is
513 * frequently read in proximity to zone->lock. It's good to
530 * of pageblock. Protected by zone->lock. argument
548 /* zone flags, see below */ argument
593 /* Zone statistics */
610 ZONE_BOOSTED_WATERMARK, /* zone recently boosted watermarks. argument
615 static inline unsigned long zone_managed_pages(struct zone *zone) in zone_managed_pages() argument
617 return (unsigned long)atomic_long_read(&zone->managed_pages); in zone_managed_pages()
620 static inline unsigned long zone_end_pfn(const struct zone *zone) in zone_end_pfn() argument
622 return zone->zone_start_pfn + zone->spanned_pages; in zone_end_pfn()
625 static inline bool zone_spans_pfn(const struct zone *zone, unsigned long pfn) in zone_spans_pfn() argument
627 return zone->zone_start_pfn <= pfn && pfn < zone_end_pfn(zone); in zone_spans_pfn()
630 static inline bool zone_is_initialized(struct zone *zone) in zone_is_initialized() argument
632 return zone->initialized; in zone_is_initialized()
635 static inline bool zone_is_empty(struct zone *zone) in zone_is_empty() argument
637 return zone->spanned_pages == 0; in zone_is_empty()
642 * intersection with the given zone
644 static inline bool zone_intersects(struct zone *zone, in zone_intersects() argument
647 if (zone_is_empty(zone)) in zone_intersects()
649 if (start_pfn >= zone_end_pfn(zone) || in zone_intersects()
650 start_pfn + nr_pages <= zone->zone_start_pfn) in zone_intersects()
679 * This struct contains information about a zone in a zonelist. It is stored
683 struct zone *zone; /* Pointer to actual zone */ member
684 int zone_idx; /* zone_idx(zoneref->zone) */
693 * To speed the reading of the zonelist, the zonerefs contain the zone index
697 * zonelist_zone() - Return the struct zone * for an entry in _zonerefs
698 * zonelist_zone_idx() - Return the index of the zone for an entry
724 * per-zone basis.
732 struct zone node_zones[MAX_NR_ZONES];
759 * Nests above zone->lock and zone->span_seqlock
856 void wakeup_kswapd(struct zone *zone, gfp_t gfp_mask, int order,
858 bool __zone_watermark_ok(struct zone *z, unsigned int order, unsigned long mark,
861 bool zone_watermark_ok(struct zone *z, unsigned int order,
864 bool zone_watermark_ok_safe(struct zone *z, unsigned int order,
875 extern void init_currently_empty_zone(struct zone *zone, unsigned long start_pfn,
898 * zone_idx() returns 0 for the ZONE_DMA zone, 1 for the ZONE_NORMAL zone, etc.
900 #define zone_idx(zone) ((zone) - (zone)->zone_pgdat->node_zones) argument
903 * Returns true if a zone has pages managed by the buddy allocator.
905 * populated_zone(). If the whole zone is reserved then we can easily
908 static inline bool managed_zone(struct zone *zone) in managed_zone() argument
910 return zone_managed_pages(zone); in managed_zone()
913 /* Returns true if a zone has memory */
914 static inline bool populated_zone(struct zone *zone) in populated_zone() argument
916 return zone->present_pages; in populated_zone()
920 static inline int zone_to_nid(struct zone *zone) in zone_to_nid() argument
922 return zone->node; in zone_to_nid()
925 static inline void zone_set_nid(struct zone *zone, int nid) in zone_set_nid() argument
927 zone->node = nid; in zone_set_nid()
930 static inline int zone_to_nid(struct zone *zone) in zone_to_nid() argument
935 static inline void zone_set_nid(struct zone *zone, int nid) {} in zone_set_nid() argument
962 * is_highmem - helper function to quickly check if a struct zone is a
963 * highmem zone or not. This is an attempt to keep references
965 * @zone - pointer to struct zone variable
967 static inline int is_highmem(struct zone *zone) in is_highmem() argument
970 return is_highmem_idx(zone_idx(zone)); in is_highmem()
976 /* These two functions are used to setup the per zone pages min values */
1012 extern struct zone *next_zone(struct zone *zone);
1024 * @zone - pointer to struct zone variable
1026 * The user only needs to declare the zone variable, for_each_zone
1029 #define for_each_zone(zone) \ argument
1030 for (zone = (first_online_pgdat())->node_zones; \
1031 zone; \
1032 zone = next_zone(zone))
1034 #define for_each_populated_zone(zone) \ argument
1035 for (zone = (first_online_pgdat())->node_zones; \
1036 zone; \
1037 zone = next_zone(zone)) \
1038 if (!populated_zone(zone)) \
1042 static inline struct zone *zonelist_zone(struct zoneref *zoneref) in zonelist_zone()
1044 return zoneref->zone; in zonelist_zone()
1054 return zone_to_nid(zoneref->zone); in zonelist_node_idx()
1062 …* next_zones_zonelist - Returns the next zone at or below highest_zoneidx within the allowed nodem…
1064 * @highest_zoneidx - The zone index of the highest zone to return
1067 * This function returns the next zone at or below a given zone index that is
1069 * search. The zoneref returned is a cursor that represents the current zone
1083 …* first_zones_zonelist - Returns the first zone at or below highest_zoneidx within the allowed nod…
1084 * @zonelist - The zonelist to search for a suitable zone
1085 * @highest_zoneidx - The zone index of the highest zone to return
1087 * @return - Zoneref pointer for the first suitable zone found (see below)
1089 * This function returns the first zone at or below a given zone index that is
1094 * When no eligible zone is found, zoneref->zone is NULL (zoneref itself is
1107 …elper macro to iterate over valid zones in a zonelist at or below a given zone index and within a …
1108 * @zone - The current zone in the iterator
1111 * @highidx - The zone index of the highest zone to return
1114 * This iterator iterates though all zones at or below a given zone index and
1117 #define for_each_zone_zonelist_nodemask(zone, z, zlist, highidx, nodemask) \ argument
1118 for (z = first_zones_zonelist(zlist, highidx, nodemask), zone = zonelist_zone(z); \
1119 zone; \
1121 zone = zonelist_zone(z))
1123 #define for_next_zone_zonelist_nodemask(zone, z, highidx, nodemask) \ argument
1124 for (zone = z->zone; \
1125 zone; \
1127 zone = zonelist_zone(z))
1131 …ne_zonelist - helper macro to iterate over valid zones in a zonelist at or below a given zone index
1132 * @zone - The current zone in the iterator
1135 * @highidx - The zone index of the highest zone to return
1137 * This iterator iterates though all zones at or below a given zone index.
1139 #define for_each_zone_zonelist(zone, z, zlist, highidx) \ argument
1140 for_each_zone_zonelist_nodemask(zone, z, zlist, highidx, NULL)
1205 /* See declaration of similar field in struct zone */
1472 * the zone and PFN linkages are still valid. This is expensive, but walkers
1476 struct page *page, struct zone *zone);
1479 struct page *page, struct zone *zone) in memmap_valid_within() argument