Lines Matching refs:pgdat
1473 static bool pgdat_free_space_enough(struct pglist_data *pgdat) in pgdat_free_space_enough() argument
1479 pgdat->node_present_pages >> 4); in pgdat_free_space_enough()
1480 for (z = pgdat->nr_zones - 1; z >= 0; z--) { in pgdat_free_space_enough()
1481 struct zone *zone = pgdat->node_zones + z; in pgdat_free_space_enough()
1521 static bool numa_promotion_rate_limit(struct pglist_data *pgdat, in numa_promotion_rate_limit() argument
1528 mod_node_page_state(pgdat, PGPROMOTE_CANDIDATE, nr); in numa_promotion_rate_limit()
1529 nr_cand = node_page_state(pgdat, PGPROMOTE_CANDIDATE); in numa_promotion_rate_limit()
1530 start = pgdat->nbp_rl_start; in numa_promotion_rate_limit()
1532 cmpxchg(&pgdat->nbp_rl_start, start, now) == start) in numa_promotion_rate_limit()
1533 pgdat->nbp_rl_nr_cand = nr_cand; in numa_promotion_rate_limit()
1534 if (nr_cand - pgdat->nbp_rl_nr_cand >= rate_limit) in numa_promotion_rate_limit()
1541 static void numa_promotion_adjust_threshold(struct pglist_data *pgdat, in numa_promotion_adjust_threshold() argument
1550 start = pgdat->nbp_th_start; in numa_promotion_adjust_threshold()
1552 cmpxchg(&pgdat->nbp_th_start, start, now) == start) { in numa_promotion_adjust_threshold()
1555 nr_cand = node_page_state(pgdat, PGPROMOTE_CANDIDATE); in numa_promotion_adjust_threshold()
1556 diff_cand = nr_cand - pgdat->nbp_th_nr_cand; in numa_promotion_adjust_threshold()
1558 th = pgdat->nbp_threshold ? : ref_th; in numa_promotion_adjust_threshold()
1563 pgdat->nbp_th_nr_cand = nr_cand; in numa_promotion_adjust_threshold()
1564 pgdat->nbp_threshold = th; in numa_promotion_adjust_threshold()
1581 struct pglist_data *pgdat; in should_numa_migrate_memory() local
1585 pgdat = NODE_DATA(dst_nid); in should_numa_migrate_memory()
1586 if (pgdat_free_space_enough(pgdat)) { in should_numa_migrate_memory()
1588 pgdat->nbp_threshold = 0; in should_numa_migrate_memory()
1595 numa_promotion_adjust_threshold(pgdat, rate_limit, def_th); in should_numa_migrate_memory()
1597 th = pgdat->nbp_threshold ? : def_th; in should_numa_migrate_memory()
1602 return !numa_promotion_rate_limit(pgdat, rate_limit, in should_numa_migrate_memory()