From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752382AbcGGJ4S (ORCPT ); Thu, 7 Jul 2016 05:56:18 -0400 Received: from outbound-smtp04.blacknight.com ([81.17.249.35]:39463 "EHLO outbound-smtp04.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113AbcGGJ4R (ORCPT ); Thu, 7 Jul 2016 05:56:17 -0400 Date: Thu, 7 Jul 2016 10:56:13 +0100 From: Mel Gorman To: Minchan Kim Cc: Andrew Morton , Linux-MM , Rik van Riel , Vlastimil Babka , Johannes Weiner , LKML Subject: Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps Message-ID: <20160707095613.GQ11498@techsingularity.net> References: <1467403299-25786-1-git-send-email-mgorman@techsingularity.net> <1467403299-25786-9-git-send-email-mgorman@techsingularity.net> <20160705055931.GC28164@bbox> <20160705102639.GG11498@techsingularity.net> <20160706003054.GC12570@bbox> <20160706083121.GL11498@techsingularity.net> <20160707055121.GA18072@bbox> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20160707055121.GA18072@bbox> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 07, 2016 at 02:51:21PM +0900, Minchan Kim wrote: > > It becomes difficult to tell the difference between "no wakeup and init to > > zone 0" and "wakeup and reclaim for zone 0". At least that's the problem > > I ran into when I tried before settling on -1. > > Sorry for bothering you several times. I cannot parse what you mean. > I didn't mean -1 is problem here but why do we need below two lines > I removed? > What you have should be fine. The hazard initially was that both classzone_idx and kswapd_classzone_idx are enum and the signedness of enum is implementation-dependent. Using max_t avoids that but it's a subtle. I prefer the obvious check of kswapd_classzone_idx == 1 because it is clearer that we're checking for an initialised value instead of depending on a side-effect of the casting in max_t to do the right thing. I can apply it if you wish, I just don't think it helps. -- Mel Gorman SUSE Labs