linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Minchan Kim <minchan@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Mel Gorman <mgorman@techsingularity.net>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [patch v2] mm, vmscan: avoid thrashing anon lru when free + file is low
Date: Sun, 4 Jun 2017 15:27:59 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.10.1706041520410.21195@chino.kir.corp.google.com> (raw)
In-Reply-To: <20170602133637.7f6b49fbb740fb70e3b2307d@linux-foundation.org>

On Fri, 2 Jun 2017, Andrew Morton wrote:

> On Mon, 1 May 2017 14:34:21 -0700 (PDT) David Rientjes <rientjes@google.com> wrote:
> 
> > The purpose of the code that commit 623762517e23 ("revert 'mm: vmscan: do
> > not swap anon pages just because free+file is low'") reintroduces is to
> > prefer swapping anonymous memory rather than trashing the file lru.
> > 
> > If the anonymous inactive lru for the set of eligible zones is considered
> > low, however, or the length of the list for the given reclaim priority
> > does not allow for effective anonymous-only reclaiming, then avoid
> > forcing SCAN_ANON.  Forcing SCAN_ANON will end up thrashing the small
> > list and leave unreclaimed memory on the file lrus.
> > 
> > If the inactive list is insufficient, fallback to balanced reclaim so the
> > file lru doesn't remain untouched.
> > 
> 
> --- a/mm/vmscan.c~mm-vmscan-avoid-thrashing-anon-lru-when-free-file-is-low-fix
> +++ a/mm/vmscan.c
> @@ -2233,7 +2233,7 @@ static void get_scan_count(struct lruvec
>  			 * anonymous pages on the LRU in eligible zones.
>  			 * Otherwise, the small LRU gets thrashed.
>  			 */
> -			if (!inactive_list_is_low(lruvec, false, sc, false) &&
> +			if (!inactive_list_is_low(lruvec, false, memcg, sc, false) &&
>  			    lruvec_lru_size(lruvec, LRU_INACTIVE_ANON, sc->reclaim_idx)
>  					>> sc->priority) {
>  				scan_balance = SCAN_ANON;
> 
> Worried.  Did you send the correct version?
> 

The patch was written before commit 2a2e48854d70 ("mm: vmscan: fix 
IO/refault regression in cache workingset transition") was merged and 
changed inactive_list_is_low().

Your rebase looks good.  It could have used NULL instead of memcg since 
this is only for global_reclaim() and memcg will always be NULL here, but 
that's just personal preference.

  reply	other threads:[~2017-06-04 22:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18  0:06 [patch] " David Rientjes
2017-04-18  1:36 ` Minchan Kim
2017-04-18 21:32   ` David Rientjes
2017-04-19  0:14     ` Minchan Kim
2017-04-19 23:24       ` David Rientjes
2017-04-20  6:09         ` Minchan Kim
2017-05-01 21:34           ` [patch v2] " David Rientjes
2017-05-02  8:02             ` Michal Hocko
2017-05-02 20:41               ` David Rientjes
2017-05-03  6:15                 ` Michal Hocko
2017-05-03  7:06                   ` Michal Hocko
2017-05-03  8:49                     ` Michal Hocko
2017-05-03 22:52                       ` David Rientjes
2017-05-04 11:43                         ` Michal Hocko
2017-05-31 15:20             ` Michal Hocko
2017-06-02 20:36             ` Andrew Morton
2017-06-04 22:27               ` David Rientjes [this message]
2017-04-19  7:04     ` [patch] " Michal Hocko
2017-04-18  7:11 ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.10.1706041520410.21195@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=minchan@kernel.org \
    --subject='Re: [patch v2] mm, vmscan: avoid thrashing anon lru when free + file is low' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).