Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5551510ybv; Tue, 11 Feb 2020 18:26:25 -0800 (PST) X-Google-Smtp-Source: APXvYqwXjsaIgKQEZpj7veNqiEY1LE0UQo9JWaR8MSl2s4BTNjwe6N3T7QUchr5I0QjRJEJeS6xl X-Received: by 2002:a9d:7ad9:: with SMTP id m25mr7221125otn.13.1581474385047; Tue, 11 Feb 2020 18:26:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581474385; cv=none; d=google.com; s=arc-20160816; b=Dy0YBNj9x++FzrxKRB6mqt+TGsHFjqHXcQKa4daiobZzzq3b63IInsDcNvWb0K/0iZ cY8ZW3alszVuTEG+iBf1XcqRPLCb5sYYb/KmF9otTl7TxONt2mIxVwFDgX72E+0tdOCc atAIkhr54jx57UyI1eTQTz5orBkGx+o30aXwbnU3Pjr0r9aS73LJt6ubZab5jTUO56AD 7tj432bMj6nVMuRgZup53ngQb+gGqqLEOlZ0VA9G+aQjE5/UVWHBO5LGC/ST9ufi/viR fHb5c10fhMFJKkFAQZK/DFvYJspHeSdX0FDhvez91Ttfy5DIHZwwNcuJpp1mmSTAh7W4 VDTQ== 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:reply-to:message-id :subject:cc:to:from:date; bh=FYGE7xyl+JJwVyto6MSYVAkd8ZieuDl7c+U22Z8ahuc=; b=X2ReVftR+uBnG1Cj/7Qo4OuKIn0DwNMS4DxdWoKIoLL7fmxw9h4Ex3R5B0XRu0Q46G TKS6L/DB0s1hM88LAsfAHkLt+Ol60BUR8n6pYSJNiQzOeSBlQKQis3XH7zE3QsQtyIx6 NBx5QwIiMeReY/EPmOjbwJjRTCMRLDlA/FowiiLLzFhusnLpmT757wKIQgtyUBd0qZlQ 6T4XqsxJ3799Sq/wEHMF7S9iOV2H97dRV3O40onC/3xyraZHqosfNxA5nkpbkX35SOcg pQRF7MLN8iSGX7iTYlffeLY5LJsDuwWmuYgyYNO+/3UPbqKECwSFwog5OxmZwsNveizS jtuQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f23si3046523oti.283.2020.02.11.18.26.00; Tue, 11 Feb 2020 18:26:25 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727684AbgBLCZj (ORCPT + 99 others); Tue, 11 Feb 2020 21:25:39 -0500 Received: from mga07.intel.com ([134.134.136.100]:31415 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727535AbgBLCZi (ORCPT ); Tue, 11 Feb 2020 21:25:38 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2020 18:25:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,428,1574150400"; d="scan'208";a="222139494" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga007.jf.intel.com with ESMTP; 11 Feb 2020 18:25:36 -0800 Date: Wed, 12 Feb 2020 10:25:55 +0800 From: Wei Yang To: Mel Gorman Cc: Wei Yang , 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: <20200212022554.GA7855@richard> Reply-To: Wei Yang References: <20200209074145.31389-1-richardw.yang@linux.intel.com> <20200211104223.GL3466@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200211104223.GL3466@techsingularity.net> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 11, 2020 at 10:42:23AM +0000, Mel Gorman wrote: >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. > This is based on code review only. I know your concern. This is an area more like art then engineering :-) Would you mind sharing some idea why we intend to inherit the classzone_idx? And for kswapd_order, we would restart at 0 if no wakeup during reclaim. I am curious about the idea behind this design :-) >-- >Mel Gorman >SUSE Labs -- Wei Yang Help you, Help me