All of lore.kernel.org
 help / color / mirror / Atom feed
From: Minchan Kim <minchan@kernel.org>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Mel Gorman <mgorman@techsingularity.net>,
	<linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>
Subject: Re: [patch] mm, vmscan: avoid thrashing anon lru when free + file is low
Date: Thu, 20 Apr 2017 15:09:04 +0900	[thread overview]
Message-ID: <20170420060904.GA3720@bbox> (raw)
In-Reply-To: <alpine.DEB.2.10.1704191623540.48310@chino.kir.corp.google.com>

Hi David,

On Wed, Apr 19, 2017 at 04:24:48PM -0700, David Rientjes wrote:
> On Wed, 19 Apr 2017, Minchan Kim wrote:
> 
> > diff --git a/mm/vmscan.c b/mm/vmscan.c
> > index 24efcc20af91..5d2f3fa41e92 100644
> > --- a/mm/vmscan.c
> > +++ b/mm/vmscan.c
> > @@ -2174,8 +2174,17 @@ static void get_scan_count(struct lruvec *lruvec, struct mem_cgroup *memcg,
> >  		}
> >  
> >  		if (unlikely(pgdatfile + pgdatfree <= total_high_wmark)) {
> > -			scan_balance = SCAN_ANON;
> > -			goto out;
> > +			/*
> > +			 * force SCAN_ANON if inactive anonymous LRU lists of
> > +			 * eligible zones are enough pages. Otherwise, thrashing
> > +			 * can be happen on the small anonymous LRU list.
> > +			 */
> > +			if (!inactive_list_is_low(lruvec, false, NULL, sc, false) &&
> > +			     lruvec_lru_size(lruvec, LRU_INACTIVE_ANON, sc->reclaim_idx)
> > +					>> sc->priority) {
> > +				scan_balance = SCAN_ANON;
> > +				goto out;
> > +			}
> >  		}
> >  	}
> >  
> 
> Hi Minchan,
> 
> This looks good and it correctly biases against SCAN_ANON for my workload 
> that was thrashing the anon lrus.  Feel free to use parts of my changelog 
> if you'd like.

Thanks for the testing!
As considering how it's hard to find such a problem, it should be totally your
credit. So you can send the patch with detailed description. Feel free to
add my suggested-by. :)

Thanks!

WARNING: multiple messages have this Message-ID (diff)
From: Minchan Kim <minchan@kernel.org>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Mel Gorman <mgorman@techsingularity.net>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [patch] mm, vmscan: avoid thrashing anon lru when free + file is low
Date: Thu, 20 Apr 2017 15:09:04 +0900	[thread overview]
Message-ID: <20170420060904.GA3720@bbox> (raw)
In-Reply-To: <alpine.DEB.2.10.1704191623540.48310@chino.kir.corp.google.com>

Hi David,

On Wed, Apr 19, 2017 at 04:24:48PM -0700, David Rientjes wrote:
> On Wed, 19 Apr 2017, Minchan Kim wrote:
> 
> > diff --git a/mm/vmscan.c b/mm/vmscan.c
> > index 24efcc20af91..5d2f3fa41e92 100644
> > --- a/mm/vmscan.c
> > +++ b/mm/vmscan.c
> > @@ -2174,8 +2174,17 @@ static void get_scan_count(struct lruvec *lruvec, struct mem_cgroup *memcg,
> >  		}
> >  
> >  		if (unlikely(pgdatfile + pgdatfree <= total_high_wmark)) {
> > -			scan_balance = SCAN_ANON;
> > -			goto out;
> > +			/*
> > +			 * force SCAN_ANON if inactive anonymous LRU lists of
> > +			 * eligible zones are enough pages. Otherwise, thrashing
> > +			 * can be happen on the small anonymous LRU list.
> > +			 */
> > +			if (!inactive_list_is_low(lruvec, false, NULL, sc, false) &&
> > +			     lruvec_lru_size(lruvec, LRU_INACTIVE_ANON, sc->reclaim_idx)
> > +					>> sc->priority) {
> > +				scan_balance = SCAN_ANON;
> > +				goto out;
> > +			}
> >  		}
> >  	}
> >  
> 
> Hi Minchan,
> 
> This looks good and it correctly biases against SCAN_ANON for my workload 
> that was thrashing the anon lrus.  Feel free to use parts of my changelog 
> if you'd like.

Thanks for the testing!
As considering how it's hard to find such a problem, it should be totally your
credit. So you can send the patch with detailed description. Feel free to
add my suggested-by. :)

Thanks!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-04-20  6:09 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18  0:06 [patch] mm, vmscan: avoid thrashing anon lru when free + file is low David Rientjes
2017-04-18  0:06 ` David Rientjes
2017-04-18  1:36 ` Minchan Kim
2017-04-18  1:36   ` Minchan Kim
2017-04-18 21:32   ` David Rientjes
2017-04-18 21:32     ` David Rientjes
2017-04-19  0:14     ` Minchan Kim
2017-04-19  0:14       ` Minchan Kim
2017-04-19 23:24       ` David Rientjes
2017-04-19 23:24         ` David Rientjes
2017-04-20  6:09         ` Minchan Kim [this message]
2017-04-20  6:09           ` Minchan Kim
2017-05-01 21:34           ` [patch v2] " David Rientjes
2017-05-01 21:34             ` David Rientjes
2017-05-02  8:02             ` Michal Hocko
2017-05-02  8:02               ` Michal Hocko
2017-05-02 20:41               ` David Rientjes
2017-05-02 20:41                 ` David Rientjes
2017-05-03  6:15                 ` Michal Hocko
2017-05-03  6:15                   ` Michal Hocko
2017-05-03  7:06                   ` Michal Hocko
2017-05-03  7:06                     ` Michal Hocko
2017-05-03  8:49                     ` Michal Hocko
2017-05-03  8:49                       ` Michal Hocko
2017-05-03 22:52                       ` David Rientjes
2017-05-03 22:52                         ` David Rientjes
2017-05-04 11:43                         ` Michal Hocko
2017-05-04 11:43                           ` Michal Hocko
2017-05-31 15:20             ` Michal Hocko
2017-05-31 15:20               ` Michal Hocko
2017-06-02 20:36             ` Andrew Morton
2017-06-02 20:36               ` Andrew Morton
2017-06-04 22:27               ` David Rientjes
2017-06-04 22:27                 ` David Rientjes
2017-04-19  7:04     ` [patch] " Michal Hocko
2017-04-19  7:04       ` Michal Hocko
2017-04-18  7:11 ` 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=20170420060904.GA3720@bbox \
    --to=minchan@kernel.org \
    --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=rientjes@google.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.