Lines Matching defs:zone

52 		struct zone *zone;
59 /* Identify the zone and nodelist */
63 zone = &pgdat->node_zones[zoneid];
64 if (!populated_zone(zone))
70 zone->name);
73 for_each_zone_zonelist(zone, z, zonelist, zoneid)
74 pr_cont("%d:%s ", zone_to_nid(zone), zone->name);
294 * Sum pages in active regions for movable zone.
314 * This finds a zone that can be used for ZONE_MOVABLE pages. The
316 * increasing memory addresses so that the "highest" populated zone is used
335 * Find the PFN the Movable zone begins in each node. Kernel memory
565 unsigned long zone, int nid)
568 set_page_links(page, zone, nid, pfn);
577 if (!is_highmem_idx(zone))
687 * prev_end_pfn static that contains the end of previous zone
719 struct zone *zone = &pgdat->node_zones[zid];
721 if (zone_spans_pfn(zone, pfn))
775 /* If zone is ZONE_MOVABLE but memory is mirrored, it is an overlapped init */
777 overlap_memmap_init(unsigned long zone, unsigned long *pfn)
781 if (mirrored_kernelcore && zone == ZONE_MOVABLE) {
813 * - zone and node links point to zone and node that span the page if the
814 * hole is in the middle of a zone
815 * - zone and node links point to adjacent zone/node if the hole falls on
816 * the zone boundary; the pages in such holes will be prepended to the
817 * zone/node above the hole except for the trailing pages in the last
818 * section that will be appended to the zone/node below.
822 int zone, int node)
832 __init_single_page(pfn_to_page(pfn), pfn, zone, node);
838 pr_info("On node %d, zone %s: %lld pages in unavailable ranges\n",
839 node, zone_names[zone], pgcnt);
849 * zone stats (e.g., nr_isolate_pageblock) are touched.
851 void __meminit memmap_init_range(unsigned long size, int nid, unsigned long zone,
870 if (zone == ZONE_DEVICE) {
886 if (overlap_memmap_init(zone, &pfn))
895 __init_single_page(page, pfn, zone, nid);
898 if (zone == ZONE_DEVICE)
918 static void __init memmap_init_zone_range(struct zone *zone,
923 unsigned long zone_start_pfn = zone->zone_start_pfn;
924 unsigned long zone_end_pfn = zone_start_pfn + zone->spanned_pages;
925 int nid = zone_to_nid(zone), zone_id = zone_idx(zone);
952 struct zone *zone = node->node_zones + j;
954 if (!populated_zone(zone))
957 memmap_init_zone_range(zone, start_pfn, end_pfn,
967 * Append the pages in this hole to the highest zone in the last
989 * phase for it to be fully associated with a zone.
1072 void __ref memmap_init_zone_device(struct zone *zone,
1078 struct pglist_data *pgdat = zone->zone_pgdat;
1081 unsigned long zone_idx = zone_idx(zone);
1116 * The zone ranges provided by the architecture do not include ZONE_MOVABLE
1120 * is distributed. This helper function adjusts the zone ranges
1122 * highest usable zone for ZONE_MOVABLE. This preserves the assumption that
1184 /* Return the number of page frames in holes in a zone on a node */
1192 /* zone is empty, we don't have any absent pages */
1227 * Return the number of pages a zone spans in a node, including holes
1240 /* Get the start and end of the zone */
1246 /* Check that this node has pages within the zone's required range */
1250 /* Move the zone boundaries inside the node if necessary */
1260 struct zone *z;
1308 struct zone *zone = pgdat->node_zones + i;
1325 zone->zone_start_pfn = zone_start_pfn;
1327 zone->zone_start_pfn = 0;
1328 zone->spanned_pages = spanned;
1329 zone->present_pages = real_size;
1331 zone->present_early_pages = real_size;
1385 static void __meminit zone_init_internals(struct zone *zone, enum zone_type idx, int nid,
1388 atomic_long_set(&zone->managed_pages, remaining_pages);
1389 zone_set_nid(zone, nid);
1390 zone->name = zone_names[idx];
1391 zone->zone_pgdat = NODE_DATA(nid);
1392 spin_lock_init(&zone->lock);
1393 zone_seqlock_init(zone);
1394 zone_pcp_init(zone);
1397 static void __meminit zone_init_free_lists(struct zone *zone)
1401 INIT_LIST_HEAD(&zone->free_area[order].free_list[t]);
1402 zone->free_area[order].nr_free = 0;
1406 INIT_LIST_HEAD(&zone->unaccepted_pages);
1410 void __meminit init_currently_empty_zone(struct zone *zone,
1414 struct pglist_data *pgdat = zone->zone_pgdat;
1415 int zone_idx = zone_idx(zone) + 1;
1420 zone->zone_start_pfn = zone_start_pfn;
1423 "Initialising map node %d zone %lu pfns %lu -> %lu\n",
1425 (unsigned long)zone_idx(zone),
1428 zone_init_free_lists(zone);
1429 zone->initialized = 1;
1434 * Calculate the size of the zone->blockflags rounded to an unsigned long
1453 static void __ref setup_usemap(struct zone *zone)
1455 unsigned long usemapsize = usemap_size(zone->zone_start_pfn,
1456 zone->spanned_pages);
1457 zone->pageblock_flags = NULL;
1459 zone->pageblock_flags =
1461 zone_to_nid(zone));
1462 if (!zone->pageblock_flags)
1463 panic("Failed to allocate %ld bytes for zone %s pageblock flags on node %d\n",
1464 usemapsize, zone->name, zone_to_nid(zone));
1468 static inline void setup_usemap(struct zone *zone) {}
1507 * Set up the zone data structures
1549 struct zone *zone = pgdat->node_zones + z;
1551 zone->present_pages = 0;
1552 zone_init_internals(zone, z, nid, 0);
1566 struct zone *zone = pgdat->node_zones + j;
1567 unsigned long size = zone->spanned_pages;
1570 * Initialize zone->managed_pages as 0 , it will be reset
1573 zone_init_internals(zone, j, nid, zone->present_pages);
1578 setup_usemap(zone);
1579 init_currently_empty_zone(zone, zone->zone_start_pfn, size);
1620 * The zone's endpoints aren't required to be MAX_PAGE_ORDER
1717 struct zone *zone = &pgdat->node_zones[zone_type];
1718 if (populated_zone(zone)) {
1751 * free_area_init - Initialise all pg_data_t and zone data
1752 * @max_zone_pfn: an array of max PFNs for each zone
1756 * zone in each node and their holes is calculated. If the maximum PFN
1757 * between two adjacent zones match, it is assumed that the zone is empty.
1759 * that arch_max_dma32_pfn has no pages. It is also assumed that a zone
1766 int i, nid, zone;
1769 /* Record where the zone boundaries are */
1780 zone = MAX_NR_ZONES - i - 1;
1782 zone = i;
1784 if (zone == ZONE_MOVABLE)
1787 end_pfn = max(max_zone_pfn[zone], start_pfn);
1788 arch_zone_lowest_possible_pfn[zone] = start_pfn;
1789 arch_zone_highest_possible_pfn[zone] = end_pfn;
1798 /* Print out the zone ranges */
1816 pr_info("Movable zone start for each node\n");
1966 static unsigned long __init deferred_init_pages(struct zone *zone,
1969 int nid = zone_to_nid(zone);
1971 int zid = zone_idx(zone);
1980 * This function is meant to pre-load the iterator for the zone init from
1988 deferred_init_mem_pfn_range_in_zone(u64 *i, struct zone *zone,
1995 __next_mem_pfn_range_in_zone(&j, zone, spfn, epfn);
1998 * Start out by walking through the ranges in this zone that have
2002 for_each_free_mem_pfn_range_in_zone_from(j, zone, spfn, epfn) {
2025 deferred_init_maxorder(u64 *i, struct zone *zone, unsigned long *start_pfn,
2034 for_each_free_mem_pfn_range_in_zone_from(j, zone, start_pfn, end_pfn) {
2041 nr_pages += deferred_init_pages(zone, *start_pfn, t);
2052 for_each_free_mem_pfn_range_in_zone_from(j, zone, &spfn, &epfn) {
2073 struct zone *zone = arg;
2076 deferred_init_mem_pfn_range_in_zone(&i, zone, &spfn, &epfn, start_pfn);
2083 deferred_init_maxorder(&i, zone, &spfn, &epfn);
2102 struct zone *zone;
2124 * Once we unlock here, the zone cannot be grown anymore, thus if an
2125 * interrupt thread must allocate this early in boot, zone must be
2130 /* Only the highest zone is deferred */
2131 zone = pgdat->node_zones + pgdat->nr_zones - 1;
2135 while (deferred_init_mem_pfn_range_in_zone(&i, zone, &spfn, &epfn, first_init_pfn)) {
2139 .fn_arg = zone,
2151 /* Sanity check that the next zone really is unpopulated */
2152 WARN_ON(pgdat->nr_zones < MAX_NR_ZONES && populated_zone(++zone));
2162 * If this zone has deferred pages, try to grow it by initializing enough
2168 * Return true when zone was grown, otherwise return false. We return true even
2172 bool __init deferred_grow_zone(struct zone *zone, unsigned int order)
2175 pg_data_t *pgdat = zone->zone_pgdat;
2181 /* Only the last zone may have deferred pages */
2182 if (zone_end_pfn(zone) != pgdat_end_pfn(pgdat))
2188 * If someone grew this zone while we were waiting for spinlock, return
2196 /* If the zone is empty somebody else may have cleared out the zone */
2197 if (!deferred_init_mem_pfn_range_in_zone(&i, zone, &spfn, &epfn,
2214 nr_pages += deferred_init_maxorder(&i, zone, &spfn, &epfn);
2256 void set_zone_contiguous(struct zone *zone)
2258 unsigned long block_start_pfn = zone->zone_start_pfn;
2262 for (; block_start_pfn < zone_end_pfn(zone);
2266 block_end_pfn = min(block_end_pfn, zone_end_pfn(zone));
2269 block_end_pfn, zone))
2275 zone->contiguous = true;
2281 struct zone *zone;
2315 for_each_populated_zone(zone)
2316 set_zone_contiguous(zone);