From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BACAC3B187 for ; Tue, 11 Feb 2020 10:42:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6A34F206D7 for ; Tue, 11 Feb 2020 10:42:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6A34F206D7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 147016B02A6; Tue, 11 Feb 2020 05:42:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0CF846B02A7; Tue, 11 Feb 2020 05:42:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F00FA6B02A8; Tue, 11 Feb 2020 05:42:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0126.hostedemail.com [216.40.44.126]) by kanga.kvack.org (Postfix) with ESMTP id D59D76B02A6 for ; Tue, 11 Feb 2020 05:42:27 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 8CEB5181AC217 for ; Tue, 11 Feb 2020 10:42:27 +0000 (UTC) X-FDA: 76477507134.22.hope03_6cae13c384129 X-HE-Tag: hope03_6cae13c384129 X-Filterd-Recvd-Size: 2887 Received: from outbound-smtp52.blacknight.com (outbound-smtp52.blacknight.com [46.22.136.236]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Tue, 11 Feb 2020 10:42:26 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp52.blacknight.com (Postfix) with ESMTPS id 3EA11FA898 for ; Tue, 11 Feb 2020 10:42:25 +0000 (GMT) Received: (qmail 23464 invoked from network); 11 Feb 2020 10:42:25 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.18.57]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 11 Feb 2020 10:42:24 -0000 Date: Tue, 11 Feb 2020 10:42:23 +0000 From: Mel Gorman To: Wei Yang Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, shakeelb@google.com, yang.shi@linux.alibaba.com Subject: Re: [RFC Patch] mm/vmscan.c: not inherit classzone_idx from previous reclaim Message-ID: <20200211104223.GL3466@techsingularity.net> References: <20200209074145.31389-1-richardw.yang@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20200209074145.31389-1-richardw.yang@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sun, Feb 09, 2020 at 03:41:45PM +0800, Wei Yang wrote: > Before commit e716f2eb24de ("mm, vmscan: prevent kswapd sleeping > prematurely due to mismatched classzone_idx"), classzone_idx could have > two possibilities on a new loop based on whether there is a wakeup > during reclaiming: > > * 0 if no wakeup > * the classzone_idx request by wakeup > > As described in the changelog, this commit is willing to change the > first case to (MAX_NR_ZONES - 1) to avoid some premature sleep. But it > does not achieve the goal. > > There are two versions of kswapd_classzone_idx() since this change: > > * commit e716f2eb24de ("mm, vmscan: prevent kswapd sleeping > prematurely due to mismatched classzone_idx") > * commit dffcac2cb88e ("mm/vmscan.c: prevent useless kswapd loops") > > Both of them would return the classzone_idx we passed as the 2nd > parameter when (pgdat->kswapd_classzone_idx == MAX_NR_ZONES). This > means if there is no wakeup during reclaiming, we would use > classzone_idx in previous round to sleep. > This is somewhat intended. > This patch fixes the logic by using (MAX_NR_ZONES - 1) for the first > case. > Ok, what is the user-visible impact that is fixed by this patch or is this based on code review only? Please describe the test case exactly and the before and after results. I ask because this area is a magnet for regressions and intuitive ideas often lead to counter-intuitive results. -- Mel Gorman SUSE Labs