Re: [PATCH v10 08/14] mm: multi-gen LRU: support page table walks

From: Yu Zhao
Date: Sat Apr 30 2022 - 04:36:25 EST


On Fri, Apr 29, 2022 at 7:10 AM zhong jiang
<zhongjiang-ali@xxxxxxxxxxxxxxxxx> wrote:
>
> On 2022/4/7 11:15 上午, Yu Zhao wrote:
...
> > + while (!mm && mm_state->head != &mm_list->fifo) {
> > + mm = list_entry(mm_state->head, struct mm_struct, lru_gen.list);
> > +
> > + mm_state->head = mm_state->head->next;
> > +
> > + /* full scan for those added after the last iteration */
> > + if (!mm_state->tail || mm_state->tail == &mm->lru_gen.list) {
> > + mm_state->tail = mm_state->head;
> > + walk->full_scan = true;
> > + }
> > +
>
> The full_scan seems to be alway true. because mm_state->tail points to
> the first item in mm_list, hence the walker's
>
> condition mm_state->tail == &mm->lru_gen.list alway equal. Am I missing
> something?

mm_state->tail points to the first item *added after the last
iteration*. If no new items, mm_state->tail parks at mm_list->fifo.