From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753369AbcGUPzr (ORCPT ); Thu, 21 Jul 2016 11:55:47 -0400 Received: from gum.cmpxchg.org ([85.214.110.215]:53936 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753100AbcGUPzp (ORCPT ); Thu, 21 Jul 2016 11:55:45 -0400 Date: Thu, 21 Jul 2016 11:52:59 -0400 From: Johannes Weiner To: Mel Gorman Cc: Andrew Morton , Minchan Kim , Michal Hocko , Vlastimil Babka , Linux-MM , LKML Subject: Re: [PATCH 4/5] mm: consider per-zone inactive ratio to deactivate Message-ID: <20160721155259.GB30303@cmpxchg.org> References: <1469110261-7365-1-git-send-email-mgorman@techsingularity.net> <1469110261-7365-5-git-send-email-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1469110261-7365-5-git-send-email-mgorman@techsingularity.net> User-Agent: Mutt/1.6.2 (2016-07-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 21, 2016 at 03:11:00PM +0100, Mel Gorman wrote: > @@ -1981,6 +1982,32 @@ static bool inactive_list_is_low(struct lruvec *lruvec, bool file) > inactive = lruvec_lru_size(lruvec, file * LRU_FILE); > active = lruvec_lru_size(lruvec, file * LRU_FILE + LRU_ACTIVE); > > + /* > + * For global reclaim on zone-constrained allocations, it is necessary > + * to check if rotations are required for lowmem to be reclaimed. This s/rotation/deactivation/ > + * calculates the inactive/active pages available in eligible zones. > + */ > + if (global_reclaim(sc)) { > + struct pglist_data *pgdat = lruvec_pgdat(lruvec); > + int zid; > + > + for (zid = sc->reclaim_idx + 1; zid < MAX_NR_ZONES; zid++) { The emphasis on global vs. memcg reclaim is somewhat strange, because this is only about excluding pages from the balancing math that will be skipped. Memcg reclaim is never zone-restricted, but if it were, it would make sense to exclude the skipped pages there as well. Indeed, for memcg reclaim sc->reclaim_idx+1 is always MAX_NR_ZONES, and so the for loop alone will do the right thing. Can you please drop the global_reclaim() branch, the sc function parameter, and the "global reclaim" from the comment? Thanks