lkml.org 
[lkml]   [2016]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 05/10] mm: remove LRU balancing effect of temporary page isolation
On Mon, Jun 06, 2016 at 09:11:18PM -0400, Rik van Riel wrote:
> On Mon, 2016-06-06 at 18:15 -0400, Johannes Weiner wrote:
> > On Mon, Jun 06, 2016 at 05:56:09PM -0400, Rik van Riel wrote:
> > >
> > > On Mon, 2016-06-06 at 15:48 -0400, Johannes Weiner wrote:
> > > >
> > > >  
> > > > +void lru_cache_putback(struct page *page)
> > > > +{
> > > > + struct pagevec *pvec = &get_cpu_var(lru_putback_pvec);
> > > > +
> > > > + get_page(page);
> > > > + if (!pagevec_space(pvec))
> > > > + __pagevec_lru_add(pvec, false);
> > > > + pagevec_add(pvec, page);
> > > > + put_cpu_var(lru_putback_pvec);
> > > > +}
> > > >
> > > Wait a moment.
> > >
> > > So now we have a putback_lru_page, which does adjust
> > > the statistics, and an lru_cache_putback which does
> > > not?
> > >
> > > This function could use a name that is not as similar
> > > to its counterpart :)
> > lru_cache_add() and lru_cache_putback() are the two sibling
> > functions,
> > where the first influences the LRU balance and the second one
> > doesn't.
> >
> > The last hunk in the patch (obscured by showing the label instead of
> > the function name as context) updates putback_lru_page() from using
> > lru_cache_add() to using lru_cache_putback().
> >
> > Does that make sense?
>
> That means the page reclaim does not update the
> "rotated" statistics. That seems undesirable,
> no? Am I overlooking something?

Oh, reclaim doesn't use putback_lru_page(), except for the stray
unevictable corner case. It does open-coded putback in batch, and
those functions continue to update the reclaim statistics. See the
recent_scanned/recent_rotated manipulations in putback_inactive_pages(),
shrink_inactive_list(), and shrink_active_list().

putback_lru_page() is mainly used by page migration, cgroup migration,
mlock etc. - all operations which muck with the LRU for purposes other
than reclaim or aging, and so shouldn't affect the anon/file balance.

This patch only changes those LRU users, not page reclaim.

\
 
 \ /
  Last update: 2016-06-07 16:21    [W:0.109 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site