From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751158AbdAQG6Y (ORCPT ); Tue, 17 Jan 2017 01:58:24 -0500 Received: from LGEAMRELO12.lge.com ([156.147.23.52]:59981 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750787AbdAQG6X (ORCPT ); Tue, 17 Jan 2017 01:58:23 -0500 X-Original-SENDERIP: 156.147.1.126 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 165.244.249.26 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.223.161 X-Original-MAILFROM: minchan@kernel.org Date: Tue, 17 Jan 2017 15:58:19 +0900 From: Minchan Kim To: Michal Hocko CC: Johannes Weiner , Mel Gorman , Hillf Danton , , LKML , Michal Hocko Subject: Re: [PATCH 1/3] mm, vmscan: cleanup lru size claculations Message-ID: <20170117065818.GC9812@blaptop> References: <20170116160123.GB30300@cmpxchg.org> <20170116193317.20390-1-mhocko@kernel.org> MIME-Version: 1.0 In-Reply-To: <20170116193317.20390-1-mhocko@kernel.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB06/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/01/17 15:58:18, Serialize by Router on LGEKRMHUB06/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/01/17 15:58:18, Serialize complete at 2017/01/17 15:58:18 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 On Mon, Jan 16, 2017 at 08:33:15PM +0100, Michal Hocko wrote: > From: Michal Hocko > > lruvec_lru_size returns the full size of the LRU list while we sometimes > need a value reduced only to eligible zones (e.g. for lowmem requests). > inactive_list_is_low is one such user. Later patches will add more of > them. Add a new parameter to lruvec_lru_size and allow it filter out > zones which are not eligible for the given context. > > Acked-by: Johannes Weiner > Signed-off-by: Michal Hocko > --- > include/linux/mmzone.h | 2 +- > mm/vmscan.c | 88 ++++++++++++++++++++++++-------------------------- > mm/workingset.c | 2 +- > 3 files changed, 45 insertions(+), 47 deletions(-) > > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index d1d440cff60e..91f69aa0d581 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -780,7 +780,7 @@ static inline struct pglist_data *lruvec_pgdat(struct lruvec *lruvec) > #endif > } > > -extern unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru); > +extern unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru, int zone_idx); > > #ifdef CONFIG_HAVE_MEMORY_PRESENT > void memory_present(int nid, unsigned long start, unsigned long end); > diff --git a/mm/vmscan.c b/mm/vmscan.c > index cf940af609fd..1cb0ebdef305 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -234,22 +234,38 @@ bool pgdat_reclaimable(struct pglist_data *pgdat) > pgdat_reclaimable_pages(pgdat) * 6; > } > > -unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru) > +/** lruvec_lru_size - Returns the number of pages on the given LRU list. minor: /* * lruvec_lru_size I don't have any preferance but just found. Otherwise, Acked-by: Minchan Kim