Re: [PATCH v2 0/9] workingset protection/detection on the anonymous LRU list

Aaron Lu
2020-02-28T10:21:56Z

On Fri, Feb 28, 2020 at 06:56:11PM +0900, Joonsoo Kim wrote:
> On Fri, Feb 28, 2020 at 05:17:00PM +0800, Aaron Lu wrote:
> > I think LKP robot has captured these two metrics but the report didn't
> > show them, which means the number is about the same with or without
> > patch #1.
>
> robot showed these two metrics. See below.
>
> 50190319 ± 31% -35.7% 32291856 ± 14% proc-vmstat.pswpin
> 56429784 ± 21% -42.6% 32386842 ± 14% proc-vmstat.pswpout
>
> pswpin/out are improved.

Oh yes, I checked the vmstat part, while I should check proc-vmstat
part...Sorry for missing this.

>
> > > with patch #1. With large inactive list, we can easily find the
> > > frequently referenced page and it would result in less swap in/out.
> >
> > But with small inactive list, the pages that would be on inactive list
> > will stay on active list? I think the larger inactive list is mainly
> > used to give the anon page a chance to be promoted to active list now
> > that anon pages land on inactive list first, but on reclaim, I don't see
> > how a larger inactive list can cause fewer swap outs.
>
> Point is that larger inactive LRU helps to find hot pages and these
> hot pages leads to more cache hits.
>
> When a cache hit happens, no swap outs happens. But, if a cache miss
> happens, a new page is added to the LRU and then it causes the reclaim
> and swap out.

OK, I think I start to get your point. Your explanation makes sense.

> > Forgive me for my curiosity and feel free to ignore my question as I
> > don't want to waste your time on this. Your patchset looks a worthwhile
> > thing to do, it's just the robot's report on patch1 seems er...
>
> I appreciate your attention. Feel free to ask. :)

Thanks a lot for your patience and nice explanation :-)