Re: [PATCH v1 10/14] mm: multigenerational lru: core

2021-03-16 Thread Yu Zhao
On Tue, Mar 16, 2021 at 04:53:53PM +0800, Huang, Ying wrote: > Yu Zhao writes: > > > On Tue, Mar 16, 2021 at 02:52:52PM +0800, Huang, Ying wrote: > >> Yu Zhao writes: > >> > >> > On Tue, Mar 16, 2021 at 10:08:51AM +0800, Huang, Ying wrote: > >> >> Yu Zhao writes: > >> >> [snip] > >> >> > >> >

Re: [PATCH v1 10/14] mm: multigenerational lru: core

2021-03-16 Thread Huang, Ying
Yu Zhao writes: > On Tue, Mar 16, 2021 at 02:52:52PM +0800, Huang, Ying wrote: >> Yu Zhao writes: >> >> > On Tue, Mar 16, 2021 at 10:08:51AM +0800, Huang, Ying wrote: >> >> Yu Zhao writes: >> >> [snip] >> >> >> >> > +/* Main function used by foreground, background and user-triggered >> >> >

Re: [PATCH v1 10/14] mm: multigenerational lru: core

2021-03-16 Thread Yu Zhao
On Tue, Mar 16, 2021 at 02:52:52PM +0800, Huang, Ying wrote: > Yu Zhao writes: > > > On Tue, Mar 16, 2021 at 10:08:51AM +0800, Huang, Ying wrote: > >> Yu Zhao writes: > >> [snip] > >> > >> > +/* Main function used by foreground, background and user-triggered > >> > aging. */ > >> > +static boo

Re: [PATCH v1 10/14] mm: multigenerational lru: core

2021-03-15 Thread Huang, Ying
Yu Zhao writes: > On Tue, Mar 16, 2021 at 10:08:51AM +0800, Huang, Ying wrote: >> Yu Zhao writes: >> [snip] >> >> > +/* Main function used by foreground, background and user-triggered aging. >> > */ >> > +static bool walk_mm_list(struct lruvec *lruvec, unsigned long next_seq, >> > +

Re: [PATCH v1 10/14] mm: multigenerational lru: core

2021-03-15 Thread Yu Zhao
On Tue, Mar 16, 2021 at 10:08:51AM +0800, Huang, Ying wrote: > Yu Zhao writes: > [snip] > > > +/* Main function used by foreground, background and user-triggered aging. > > */ > > +static bool walk_mm_list(struct lruvec *lruvec, unsigned long next_seq, > > +struct scan_contro

Re: [PATCH v1 10/14] mm: multigenerational lru: core

2021-03-15 Thread Huang, Ying
Yu Zhao writes: [snip] > +/* Main function used by foreground, background and user-triggered aging. */ > +static bool walk_mm_list(struct lruvec *lruvec, unsigned long next_seq, > + struct scan_control *sc, int swappiness) > +{ > + bool last; > + struct mm_struct *mm

Re: [PATCH v1 10/14] mm: multigenerational lru: core

2021-03-14 Thread Yu Zhao
On Sun, Mar 14, 2021 at 07:02:01PM -0700, Andi Kleen wrote: > Yu Zhao writes: Hi Andi! Recovering the context a bit: err = -EBUSY; > > + > > +#ifdef CONFIG_MEMCG > > + if (memcg && atomic_read(&memcg->moving_account)) > > + goto contended; > > +#endi

Re: [PATCH v1 10/14] mm: multigenerational lru: core

2021-03-14 Thread Andi Kleen
Yu Zhao writes: > + > +#ifdef CONFIG_MEMCG > + if (memcg && atomic_read(&memcg->moving_account)) > + goto contended; > +#endif > + if (!mmap_read_trylock(mm)) > + goto contended; These are essentially spinloops. Surely you need a cpu

[PATCH v1 10/14] mm: multigenerational lru: core

2021-03-13 Thread Yu Zhao
Evictable pages are divided into multiple generations for each lruvec. The youngest generation number is stored in max_seq for both anon and file types as they are aged on an equal footing. The oldest generation numbers are stored in min_seq[2] separately for anon and file types as clean file pages