From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941809AbdDTGJS (ORCPT ); Thu, 20 Apr 2017 02:09:18 -0400 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:36382 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941290AbdDTGJP (ORCPT ); Thu, 20 Apr 2017 02:09:15 -0400 X-Original-SENDERIP: 156.147.1.125 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 165.244.249.23 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.223.161 X-Original-MAILFROM: minchan@kernel.org Date: Thu, 20 Apr 2017 15:09:04 +0900 From: Minchan Kim To: David Rientjes CC: Andrew Morton , Johannes Weiner , Mel Gorman , , Subject: Re: [patch] mm, vmscan: avoid thrashing anon lru when free + file is low Message-ID: <20170420060904.GA3720@bbox> References: <20170418013659.GD21354@bbox> <20170419001405.GA13364@bbox> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB04/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/04/20 15:09:04, Serialize by Router on LGEKRMHUB04/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/04/20 15:09:04, Serialize complete at 2017/04/20 15:09:04 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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!