Lines Matching refs:pgdat
2008 static bool pgdat_free_space_enough(struct pglist_data *pgdat) in pgdat_free_space_enough() argument
2014 pgdat->node_present_pages >> 4); in pgdat_free_space_enough()
2015 for (z = pgdat->nr_zones - 1; z >= 0; z--) { in pgdat_free_space_enough()
2016 struct zone *zone = pgdat->node_zones + z; in pgdat_free_space_enough()
2056 static bool numa_promotion_rate_limit(struct pglist_data *pgdat, in numa_promotion_rate_limit() argument
2063 mod_node_page_state(pgdat, PGPROMOTE_CANDIDATE, nr); in numa_promotion_rate_limit()
2064 nr_cand = node_page_state(pgdat, PGPROMOTE_CANDIDATE); in numa_promotion_rate_limit()
2065 start = pgdat->nbp_rl_start; in numa_promotion_rate_limit()
2067 cmpxchg(&pgdat->nbp_rl_start, start, now) == start) in numa_promotion_rate_limit()
2068 pgdat->nbp_rl_nr_cand = nr_cand; in numa_promotion_rate_limit()
2069 if (nr_cand - pgdat->nbp_rl_nr_cand >= rate_limit) in numa_promotion_rate_limit()
2076 static void numa_promotion_adjust_threshold(struct pglist_data *pgdat, in numa_promotion_adjust_threshold() argument
2085 start = pgdat->nbp_th_start; in numa_promotion_adjust_threshold()
2087 cmpxchg(&pgdat->nbp_th_start, start, now) == start) { in numa_promotion_adjust_threshold()
2090 nr_cand = node_page_state(pgdat, PGPROMOTE_CANDIDATE); in numa_promotion_adjust_threshold()
2091 diff_cand = nr_cand - pgdat->nbp_th_nr_cand; in numa_promotion_adjust_threshold()
2093 th = pgdat->nbp_threshold ? : ref_th; in numa_promotion_adjust_threshold()
2098 pgdat->nbp_th_nr_cand = nr_cand; in numa_promotion_adjust_threshold()
2099 pgdat->nbp_threshold = th; in numa_promotion_adjust_threshold()
2121 struct pglist_data *pgdat; in should_numa_migrate_memory() local
2126 pgdat = NODE_DATA(dst_nid); in should_numa_migrate_memory()
2127 if (pgdat_free_space_enough(pgdat)) { in should_numa_migrate_memory()
2129 pgdat->nbp_threshold = 0; in should_numa_migrate_memory()
2130 mod_node_page_state(pgdat, PGPROMOTE_CANDIDATE_NRL, nr); in should_numa_migrate_memory()
2136 numa_promotion_adjust_threshold(pgdat, rate_limit, def_th); in should_numa_migrate_memory()
2138 th = pgdat->nbp_threshold ? : def_th; in should_numa_migrate_memory()
2143 return !numa_promotion_rate_limit(pgdat, rate_limit, nr); in should_numa_migrate_memory()