Lines Matching refs:zone
38 static void zero_zone_numa_counters(struct zone *zone) in zero_zone_numa_counters() argument
43 atomic_long_set(&zone->vm_numa_event[item], 0); in zero_zone_numa_counters()
45 per_cpu_ptr(zone->per_cpu_zonestats, cpu)->vm_numa_event[item] in zero_zone_numa_counters()
54 struct zone *zone; in zero_zones_numa_counters() local
56 for_each_populated_zone(zone) in zero_zones_numa_counters()
57 zero_zone_numa_counters(zone); in zero_zones_numa_counters()
170 int calculate_pressure_threshold(struct zone *zone) in calculate_pressure_threshold() argument
183 watermark_distance = low_wmark_pages(zone) - min_wmark_pages(zone); in calculate_pressure_threshold()
194 int calculate_normal_threshold(struct zone *zone) in calculate_normal_threshold() argument
229 mem = zone_managed_pages(zone) >> (27 - PAGE_SHIFT); in calculate_normal_threshold()
247 struct zone *zone; in refresh_zone_stat_thresholds() local
258 for_each_populated_zone(zone) { in refresh_zone_stat_thresholds()
259 struct pglist_data *pgdat = zone->zone_pgdat; in refresh_zone_stat_thresholds()
262 threshold = calculate_normal_threshold(zone); in refresh_zone_stat_thresholds()
267 per_cpu_ptr(zone->per_cpu_zonestats, cpu)->stat_threshold in refresh_zone_stat_thresholds()
281 tolerate_drift = low_wmark_pages(zone) - min_wmark_pages(zone); in refresh_zone_stat_thresholds()
284 zone->percpu_drift_mark = high_wmark_pages(zone) + in refresh_zone_stat_thresholds()
290 int (*calculate_pressure)(struct zone *)) in set_pgdat_percpu_threshold() argument
292 struct zone *zone; in set_pgdat_percpu_threshold() local
298 zone = &pgdat->node_zones[i]; in set_pgdat_percpu_threshold()
299 if (!zone->percpu_drift_mark) in set_pgdat_percpu_threshold()
302 threshold = (*calculate_pressure)(zone); in set_pgdat_percpu_threshold()
304 per_cpu_ptr(zone->per_cpu_zonestats, cpu)->stat_threshold in set_pgdat_percpu_threshold()
314 void __mod_zone_page_state(struct zone *zone, enum zone_stat_item item, in __mod_zone_page_state() argument
317 struct per_cpu_zonestat __percpu *pcp = zone->per_cpu_zonestats; in __mod_zone_page_state()
337 zone_page_state_add(x, zone, item); in __mod_zone_page_state()
408 void __inc_zone_state(struct zone *zone, enum zone_stat_item item) in __inc_zone_state() argument
410 struct per_cpu_zonestat __percpu *pcp = zone->per_cpu_zonestats; in __inc_zone_state()
423 zone_page_state_add(v + overstep, zone, item); in __inc_zone_state()
468 void __dec_zone_state(struct zone *zone, enum zone_stat_item item) in __dec_zone_state() argument
470 struct per_cpu_zonestat __percpu *pcp = zone->per_cpu_zonestats; in __dec_zone_state()
483 zone_page_state_add(v - overstep, zone, item); in __dec_zone_state()
541 static inline void mod_zone_state(struct zone *zone, in mod_zone_state() argument
544 struct per_cpu_zonestat __percpu *pcp = zone->per_cpu_zonestats; in mod_zone_state()
576 zone_page_state_add(z, zone, item); in mod_zone_state()
579 void mod_zone_page_state(struct zone *zone, enum zone_stat_item item, in mod_zone_page_state() argument
582 mod_zone_state(zone, item, delta, 0); in mod_zone_page_state()
674 void mod_zone_page_state(struct zone *zone, enum zone_stat_item item, in mod_zone_page_state() argument
680 __mod_zone_page_state(zone, item, delta); in mod_zone_page_state()
688 struct zone *zone; in inc_zone_page_state() local
690 zone = page_zone(page); in inc_zone_page_state()
692 __inc_zone_state(zone, item); in inc_zone_page_state()
775 static void fold_vm_zone_numa_events(struct zone *zone) in fold_vm_zone_numa_events() argument
784 pzstats = per_cpu_ptr(zone->per_cpu_zonestats, cpu); in fold_vm_zone_numa_events()
790 zone_numa_event_add(zone_numa_events[item], zone, item); in fold_vm_zone_numa_events()
795 struct zone *zone; in fold_vm_numa_events() local
797 for_each_populated_zone(zone) in fold_vm_numa_events()
798 fold_vm_zone_numa_events(zone); in fold_vm_numa_events()
821 struct zone *zone; in refresh_cpu_vm_stats() local
827 for_each_populated_zone(zone) { in refresh_cpu_vm_stats()
828 struct per_cpu_zonestat __percpu *pzstats = zone->per_cpu_zonestats; in refresh_cpu_vm_stats()
830 struct per_cpu_pages __percpu *pcp = zone->per_cpu_pageset; in refresh_cpu_vm_stats()
839 atomic_long_add(v, &zone->vm_stat[i]); in refresh_cpu_vm_stats()
865 if (zone_to_nid(zone) == numa_node_id()) { in refresh_cpu_vm_stats()
874 drain_zone_pages(zone, this_cpu_ptr(pcp)); in refresh_cpu_vm_stats()
907 struct zone *zone; in cpu_vm_stats_fold() local
912 for_each_populated_zone(zone) { in cpu_vm_stats_fold()
915 pzstats = per_cpu_ptr(zone->per_cpu_zonestats, cpu); in cpu_vm_stats_fold()
923 atomic_long_add(v, &zone->vm_stat[i]); in cpu_vm_stats_fold()
934 zone_numa_event_add(v, zone, i); in cpu_vm_stats_fold()
963 void drain_zonestat(struct zone *zone, struct per_cpu_zonestat *pzstats) in drain_zonestat() argument
972 zone_page_state_add(v, zone, i); in drain_zonestat()
981 zone_numa_event_add(v, zone, i); in drain_zonestat()
997 struct zone *zones = NODE_DATA(node)->node_zones; in sum_zone_node_page_state()
1011 struct zone *zones = NODE_DATA(node)->node_zones; in sum_zone_numa_event_state()
1060 static void fill_contig_page_info(struct zone *zone, in fill_contig_page_info() argument
1074 blocks = zone->free_area[order].nr_free; in fill_contig_page_info()
1122 unsigned int extfrag_for_order(struct zone *zone, unsigned int order) in extfrag_for_order() argument
1126 fill_contig_page_info(zone, order, &info); in extfrag_for_order()
1136 int fragmentation_index(struct zone *zone, unsigned int order) in fragmentation_index() argument
1140 fill_contig_page_info(zone, order, &info); in fragmentation_index()
1446 void (*print)(struct seq_file *m, pg_data_t *, struct zone *)) in walk_zones_in_node() argument
1448 struct zone *zone; in walk_zones_in_node() local
1449 struct zone *node_zones = pgdat->node_zones; in walk_zones_in_node()
1452 for (zone = node_zones; zone - node_zones < MAX_NR_ZONES; ++zone) { in walk_zones_in_node()
1453 if (assert_populated && !populated_zone(zone)) in walk_zones_in_node()
1457 spin_lock_irqsave(&zone->lock, flags); in walk_zones_in_node()
1458 print(m, pgdat, zone); in walk_zones_in_node()
1460 spin_unlock_irqrestore(&zone->lock, flags); in walk_zones_in_node()
1467 struct zone *zone) in frag_show_print() argument
1471 seq_printf(m, "Node %d, zone %8s ", pgdat->node_id, zone->name); in frag_show_print()
1473 seq_printf(m, "%6lu ", zone->free_area[order].nr_free); in frag_show_print()
1488 pg_data_t *pgdat, struct zone *zone) in pagetypeinfo_showfree_print() argument
1495 zone->name, in pagetypeinfo_showfree_print()
1503 area = &(zone->free_area[order]); in pagetypeinfo_showfree_print()
1521 spin_unlock_irq(&zone->lock); in pagetypeinfo_showfree_print()
1523 spin_lock_irq(&zone->lock); in pagetypeinfo_showfree_print()
1545 pg_data_t *pgdat, struct zone *zone) in pagetypeinfo_showblockcount_print() argument
1549 unsigned long start_pfn = zone->zone_start_pfn; in pagetypeinfo_showblockcount_print()
1550 unsigned long end_pfn = zone_end_pfn(zone); in pagetypeinfo_showblockcount_print()
1560 if (page_zone(page) != zone) in pagetypeinfo_showblockcount_print()
1570 seq_printf(m, "Node %d, zone %8s ", pgdat->node_id, zone->name); in pagetypeinfo_showblockcount_print()
1652 static bool is_zone_first_populated(pg_data_t *pgdat, struct zone *zone) in is_zone_first_populated() argument
1657 struct zone *compare = &pgdat->node_zones[zid]; in is_zone_first_populated()
1660 return zone == compare; in is_zone_first_populated()
1667 struct zone *zone) in zoneinfo_show_print() argument
1670 seq_printf(m, "Node %d, zone %8s", pgdat->node_id, zone->name); in zoneinfo_show_print()
1671 if (is_zone_first_populated(pgdat, zone)) { in zoneinfo_show_print()
1691 zone_page_state(zone, NR_FREE_PAGES), in zoneinfo_show_print()
1692 min_wmark_pages(zone), in zoneinfo_show_print()
1693 low_wmark_pages(zone), in zoneinfo_show_print()
1694 high_wmark_pages(zone), in zoneinfo_show_print()
1695 zone->spanned_pages, in zoneinfo_show_print()
1696 zone->present_pages, in zoneinfo_show_print()
1697 zone_managed_pages(zone), in zoneinfo_show_print()
1698 zone_cma_pages(zone)); in zoneinfo_show_print()
1702 zone->lowmem_reserve[0]); in zoneinfo_show_print()
1703 for (i = 1; i < ARRAY_SIZE(zone->lowmem_reserve); i++) in zoneinfo_show_print()
1704 seq_printf(m, ", %ld", zone->lowmem_reserve[i]); in zoneinfo_show_print()
1708 if (!populated_zone(zone)) { in zoneinfo_show_print()
1715 zone_page_state(zone, i)); in zoneinfo_show_print()
1720 zone_numa_event_state(zone, i)); in zoneinfo_show_print()
1728 pcp = per_cpu_ptr(zone->per_cpu_pageset, i); in zoneinfo_show_print()
1739 pzstats = per_cpu_ptr(zone->per_cpu_zonestats, i); in zoneinfo_show_print()
1748 zone->zone_start_pfn); in zoneinfo_show_print()
1954 struct zone *zone; in need_update() local
1956 for_each_populated_zone(zone) { in need_update()
1957 struct per_cpu_zonestat *pzstats = per_cpu_ptr(zone->per_cpu_zonestats, cpu); in need_update()
1966 if (last_pgdat == zone->zone_pgdat) in need_update()
1968 last_pgdat = zone->zone_pgdat; in need_update()
1969 n = per_cpu_ptr(zone->zone_pgdat->per_cpu_nodestats, cpu); in need_update()
2143 pg_data_t *pgdat, struct zone *zone) in unusable_show_print() argument
2151 zone->name); in unusable_show_print()
2153 fill_contig_page_info(zone, order, &info); in unusable_show_print()
2193 pg_data_t *pgdat, struct zone *zone) in extfrag_show_print() argument
2203 zone->name); in extfrag_show_print()
2205 fill_contig_page_info(zone, order, &info); in extfrag_show_print()