Lines Matching refs:mm_state
2715 static bool test_bloom_filter(struct lru_gen_mm_state *mm_state, unsigned long seq, in test_bloom_filter() argument
2722 filter = READ_ONCE(mm_state->filters[gen]); in test_bloom_filter()
2731 static void update_bloom_filter(struct lru_gen_mm_state *mm_state, unsigned long seq, in update_bloom_filter() argument
2738 filter = READ_ONCE(mm_state->filters[gen]); in update_bloom_filter()
2750 static void reset_bloom_filter(struct lru_gen_mm_state *mm_state, unsigned long seq) in reset_bloom_filter() argument
2755 filter = mm_state->filters[gen]; in reset_bloom_filter()
2763 WRITE_ONCE(mm_state->filters[gen], filter); in reset_bloom_filter()
2790 return &lruvec->mm_state; in get_mm_state()
2798 struct lru_gen_mm_state *mm_state = get_mm_state(walk->lruvec); in get_next_mm() local
2800 mm = list_entry(mm_state->head, struct mm_struct, lru_gen.list); in get_next_mm()
2826 struct lru_gen_mm_state *mm_state = get_mm_state(lruvec); in lru_gen_add_mm() local
2829 if (mm_state->tail == &mm_list->fifo) in lru_gen_add_mm()
2830 mm_state->tail = &mm->lru_gen.list; in lru_gen_add_mm()
2856 struct lru_gen_mm_state *mm_state = get_mm_state(lruvec); in lru_gen_del_mm() local
2859 if (mm_state->head == &mm->lru_gen.list) in lru_gen_del_mm()
2860 mm_state->head = mm_state->head->prev; in lru_gen_del_mm()
2863 if (mm_state->tail == &mm->lru_gen.list) in lru_gen_del_mm()
2864 mm_state->tail = mm_state->tail->next; in lru_gen_del_mm()
2931 struct lru_gen_mm_state *mm_state = get_mm_state(lruvec); in reset_mm_stats() local
2938 WRITE_ONCE(mm_state->stats[hist][i], in reset_mm_stats()
2939 mm_state->stats[hist][i] + walk->mm_stats[i]); in reset_mm_stats()
2947 WRITE_ONCE(mm_state->stats[hist][i], 0); in reset_mm_stats()
2959 struct lru_gen_mm_state *mm_state = get_mm_state(lruvec); in iterate_mm_list() local
2973 VM_WARN_ON_ONCE(mm_state->seq + 1 < walk->seq); in iterate_mm_list()
2975 if (walk->seq <= mm_state->seq) in iterate_mm_list()
2978 if (!mm_state->head) in iterate_mm_list()
2979 mm_state->head = &mm_list->fifo; in iterate_mm_list()
2981 if (mm_state->head == &mm_list->fifo) in iterate_mm_list()
2985 mm_state->head = mm_state->head->next; in iterate_mm_list()
2986 if (mm_state->head == &mm_list->fifo) { in iterate_mm_list()
2987 WRITE_ONCE(mm_state->seq, mm_state->seq + 1); in iterate_mm_list()
2993 if (!mm_state->tail || mm_state->tail == mm_state->head) { in iterate_mm_list()
2994 mm_state->tail = mm_state->head->next; in iterate_mm_list()
3005 reset_bloom_filter(mm_state, walk->seq + 1); in iterate_mm_list()
3020 struct lru_gen_mm_state *mm_state = get_mm_state(lruvec); in iterate_mm_list_nowalk() local
3024 VM_WARN_ON_ONCE(mm_state->seq + 1 < seq); in iterate_mm_list_nowalk()
3026 if (seq > mm_state->seq) { in iterate_mm_list_nowalk()
3027 mm_state->head = NULL; in iterate_mm_list_nowalk()
3028 mm_state->tail = NULL; in iterate_mm_list_nowalk()
3029 WRITE_ONCE(mm_state->seq, mm_state->seq + 1); in iterate_mm_list_nowalk()
3535 struct lru_gen_mm_state *mm_state = get_mm_state(walk->lruvec); in walk_pmd_range() local
3577 if (!walk->force_scan && !test_bloom_filter(mm_state, walk->seq, pmd + i)) in walk_pmd_range()
3588 update_bloom_filter(mm_state, walk->seq + 1, pmd + i); in walk_pmd_range()
3871 struct lru_gen_mm_state *mm_state = get_mm_state(lruvec); in try_to_inc_max_seq() local
3875 if (!mm_state) in try_to_inc_max_seq()
3879 if (seq <= READ_ONCE(mm_state->seq)) in try_to_inc_max_seq()
4059 struct lru_gen_mm_state *mm_state = get_mm_state(lruvec); in lru_gen_look_around() local
4145 if (mm_state && suitable_to_scan(i, young)) in lru_gen_look_around()
4146 update_bloom_filter(mm_state, max_seq, pvmw->pmd); in lru_gen_look_around()
5258 struct lru_gen_mm_state *mm_state = get_mm_state(lruvec); in lru_gen_seq_show_full() local
5284 if (!mm_state) in lru_gen_seq_show_full()
5294 n = READ_ONCE(mm_state->stats[hist][i]); in lru_gen_seq_show_full()
5297 n = READ_ONCE(mm_state->stats[hist][i]); in lru_gen_seq_show_full()
5578 struct lru_gen_mm_state *mm_state = get_mm_state(lruvec); in lru_gen_init_lruvec() local
5589 if (mm_state) in lru_gen_init_lruvec()
5590 mm_state->seq = MIN_NR_GENS; in lru_gen_init_lruvec()
5616 struct lru_gen_mm_state *mm_state = get_mm_state(lruvec); in lru_gen_exit_memcg() local
5623 if (!mm_state) in lru_gen_exit_memcg()
5627 bitmap_free(mm_state->filters[i]); in lru_gen_exit_memcg()
5628 mm_state->filters[i] = NULL; in lru_gen_exit_memcg()