Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4750657ybv; Tue, 11 Feb 2020 02:44:36 -0800 (PST) X-Google-Smtp-Source: APXvYqxzZZtO8OYj6Gix+FaBxMPSj15QodPnpTbM7iz1AXz/ZLCKykvSL6dbFWzwRZnV0bCC9dHS X-Received: by 2002:a05:6830:1bd5:: with SMTP id v21mr5008728ota.154.1581417876092; Tue, 11 Feb 2020 02:44:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581417876; cv=none; d=google.com; s=arc-20160816; b=qIC5uMb7KH9S9VF3U9wRnCbPn2DAzh74QzzpPuOtNn4tjqdqsJZpfqBj+JIuSZD3dI dkziheztbCTFEhIm+dUAAxfe67k91Y6Qq9FPmheToPfxym6y+6sinXj0IGVnLK++yLST VJIjrcPsP7SFmuI3ZqKEPPUxRpGDz0+Z6VYzrfXt4WlSRj/ZcZeJHfknzj4Q2Bxby+fq h5bSrnQmPiI8opYFQexNwh8V+a3oTo4fMbRobdy3ztEbKhXIFFyTyaHvojCMx70Ox053 7LSQoUUc9BQAeuIz8/Oe0iMWgaWJaiiHI1xcqQCeIOyE5wLx6PaG0+yNSwJbnORyOwvr t3/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=5i4LDGcAdnp8cANCTL/+eAVToT7CrZ7YIhai+F0mUIY=; b=aLBXu9bBGMs8hMa1Mafx8O1CYNEy9liafiPZ7WIjfZMXV2e5x3ZqHWJnzSkUfzclOl a4jKJWj8xctb06QSWlGWKomBhRNqHfy43pyYrJqX1KY9Dv3AnY2qiv7WykHfSclYayO/ JmK3RPWJPgUiC1S6+wS/Z1vOiP8+cVVd4MW0XbBz0FaH1e9cXotf4mVOduwwL8msxawe zVpKaMLPvfKDeqqw2PBGoNqZeoVwMGIFZ02l7rBEgkXvebZljHcLw3GlQu5hs8FMlf3F 2hX16kZ7LnwPdA/cgxrb6EcivxF2d9Dr7FZIS0+JfI2Rs9IP+ONNYluRekF0TUAfjFfm L62g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9si1792703otp.57.2020.02.11.02.44.23; Tue, 11 Feb 2020 02:44:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728386AbgBKKm1 (ORCPT + 99 others); Tue, 11 Feb 2020 05:42:27 -0500 Received: from outbound-smtp17.blacknight.com ([46.22.139.234]:41926 "EHLO outbound-smtp17.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727805AbgBKKm0 (ORCPT ); Tue, 11 Feb 2020 05:42:26 -0500 Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp17.blacknight.com (Postfix) with ESMTPS id 27C0A1C2C4D 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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