Lines Matching full:tier
151 /* Always discard instead of demoting to lower tier memory */
1529 * Reclaiming directly from top tier nodes is not often desired in shrink_folio_list()
1531 * should be reclaimed from lower tier nodes and demoted from in shrink_folio_list()
1532 * top tier nodes. in shrink_folio_list()
1534 * However, disabling reclaim from top tier nodes entirely in shrink_folio_list()
1535 * would cause ooms in edge scenarios where lower tier memory in shrink_folio_list()
1538 * from top tier nodes in proactive reclaim though as that is in shrink_folio_list()
3045 * The P term is refaulted/(evicted+protected) from a tier in the generation
3050 * The setpoint (SP) is always the first tier of one type; the process variable
3051 * (PV) is either any tier of the other type or any other tier of the same
3067 static void read_ctrl_pos(struct lruvec *lruvec, int type, int tier, int gain, in read_ctrl_pos() argument
3073 pos->refaulted = lrugen->avg_refaulted[type][tier] + in read_ctrl_pos()
3074 atomic_long_read(&lrugen->refaulted[hist][type][tier]); in read_ctrl_pos()
3075 pos->total = lrugen->avg_total[type][tier] + in read_ctrl_pos()
3076 atomic_long_read(&lrugen->evicted[hist][type][tier]); in read_ctrl_pos()
3077 if (tier) in read_ctrl_pos()
3078 pos->total += lrugen->protected[hist][type][tier - 1]; in read_ctrl_pos()
3084 int hist, tier; in reset_ctrl_pos() local
3096 for (tier = 0; tier < MAX_NR_TIERS; tier++) { in reset_ctrl_pos()
3100 sum = lrugen->avg_refaulted[type][tier] + in reset_ctrl_pos()
3101 atomic_long_read(&lrugen->refaulted[hist][type][tier]); in reset_ctrl_pos()
3102 WRITE_ONCE(lrugen->avg_refaulted[type][tier], sum / 2); in reset_ctrl_pos()
3104 sum = lrugen->avg_total[type][tier] + in reset_ctrl_pos()
3105 atomic_long_read(&lrugen->evicted[hist][type][tier]); in reset_ctrl_pos()
3106 if (tier) in reset_ctrl_pos()
3107 sum += lrugen->protected[hist][type][tier - 1]; in reset_ctrl_pos()
3108 WRITE_ONCE(lrugen->avg_total[type][tier], sum / 2); in reset_ctrl_pos()
3112 atomic_long_set(&lrugen->refaulted[hist][type][tier], 0); in reset_ctrl_pos()
3113 atomic_long_set(&lrugen->evicted[hist][type][tier], 0); in reset_ctrl_pos()
3114 if (tier) in reset_ctrl_pos()
3115 WRITE_ONCE(lrugen->protected[hist][type][tier - 1], 0); in reset_ctrl_pos()
4298 int tier = lru_tier_from_refs(refs); in sort_folio() local
4320 if (tier > tier_idx || refs == BIT(LRU_REFS_WIDTH)) { in sort_folio()
4326 WRITE_ONCE(lrugen->protected[hist][type][tier - 1], in sort_folio()
4327 lrugen->protected[hist][type][tier - 1] + delta); in sort_folio()
4384 int type, int tier, struct list_head *list) in scan_folios() argument
4421 if (sort_folio(lruvec, folio, sc, tier)) in scan_folios()
4466 int tier; in get_tier_idx() local
4471 * This value is chosen because any other tier would have at least twice in get_tier_idx()
4472 * as many refaults as the first tier. in get_tier_idx()
4475 for (tier = 1; tier < MAX_NR_TIERS; tier++) { in get_tier_idx()
4476 read_ctrl_pos(lruvec, type, tier, 2, &pv); in get_tier_idx()
4481 return tier - 1; in get_tier_idx()
4486 int type, tier; in get_type_to_scan() local
4491 * Compare the first tier of anon with that of file to determine which in get_type_to_scan()
4493 * with the first tier of the other type to determine the last tier (of in get_type_to_scan()
4501 for (tier = 1; tier < MAX_NR_TIERS; tier++) { in get_type_to_scan()
4502 read_ctrl_pos(lruvec, type, tier, gain[type], &pv); in get_type_to_scan()
4507 *tier_idx = tier - 1; in get_type_to_scan()
4518 int tier = -1; in isolate_folios() local
4540 type = get_type_to_scan(lruvec, swappiness, &tier); in isolate_folios()
4543 if (tier < 0) in isolate_folios()
4544 tier = get_tier_idx(lruvec, type); in isolate_folios()
4546 scanned = scan_folios(lruvec, sc, type, tier, list); in isolate_folios()
4551 tier = -1; in isolate_folios()
5255 int type, tier; in lru_gen_seq_show_full() local
5260 for (tier = 0; tier < MAX_NR_TIERS; tier++) { in lru_gen_seq_show_full()
5261 seq_printf(m, " %10d", tier); in lru_gen_seq_show_full()
5268 n[0] = READ_ONCE(lrugen->avg_refaulted[type][tier]); in lru_gen_seq_show_full()
5269 n[1] = READ_ONCE(lrugen->avg_total[type][tier]); in lru_gen_seq_show_full()
5272 n[0] = atomic_long_read(&lrugen->refaulted[hist][type][tier]); in lru_gen_seq_show_full()
5273 n[1] = atomic_long_read(&lrugen->evicted[hist][type][tier]); in lru_gen_seq_show_full()
5274 if (tier) in lru_gen_seq_show_full()
5275 n[2] = READ_ONCE(lrugen->protected[hist][type][tier - 1]); in lru_gen_seq_show_full()