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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E61A0C433F5 for ; Thu, 14 Apr 2022 07:09:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 592586B0071; Thu, 14 Apr 2022 03:09:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 541456B0073; Thu, 14 Apr 2022 03:09:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3E2FC6B0074; Thu, 14 Apr 2022 03:09:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 2A9EA6B0071 for ; Thu, 14 Apr 2022 03:09:50 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E7FF825B80 for ; Thu, 14 Apr 2022 07:09:49 +0000 (UTC) X-FDA: 79354609698.10.F1F40EB Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by imf02.hostedemail.com (Postfix) with ESMTP id E07BA80006 for ; Thu, 14 Apr 2022 07:09:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649920188; x=1681456188; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=i31Itq3+QX6wvkcua8Gayai8JJVK/xFYQxC6/o50e9Q=; b=lu5MZDz+OHliZcPKw8gV1BFv/xXttV5Tc1K8m1PYSKaPjr4W0mNYMwzE FHQ8du3PrH0+7AeIDNy0jU37lzQXmFjqk52rhGoSEFk5o3SUCHwfjbCH+ ct4bcwACsJ/Ek5sQVMmb2n4yXEuTHSXirUSryDrmx2T2gtiFdN3bcfsj9 Hgw4NIoXU2tfEgkg8FFQaYKrYPAkvu3SrS5bS6AVZ0f/xbQxezO/eoW9R zy6Q6/PHLjFF7IGeV6rqhysm+MUvhMFrChvwbFObook1cAP5oimzmNijd L3nr5fBaPadGlMIYTMROPPK/H1a83HXb3Wrx5KsKpC5ooVqTcw74Ntuym g==; X-IronPort-AV: E=McAfee;i="6400,9594,10316"; a="260461893" X-IronPort-AV: E=Sophos;i="5.90,259,1643702400"; d="scan'208";a="260461893" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2022 00:09:47 -0700 X-IronPort-AV: E=Sophos;i="5.90,259,1643702400"; d="scan'208";a="552549964" Received: from xikunjia-mobl1.ccr.corp.intel.com ([10.254.215.168]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2022 00:09:45 -0700 Message-ID: <4288cbad49690d7c4eb2b1d705eea01221ab8328.camel@intel.com> Subject: Re: [PATCH v2 1/5] mm: demotion: Set demotion list differently From: "ying.huang@intel.com" To: Jagdish Gediya , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: akpm@linux-foundation.org, aneesh.kumar@linux.ibm.com, baolin.wang@linux.alibaba.com, dave.hansen@linux.intel.com Date: Thu, 14 Apr 2022 15:09:42 +0800 In-Reply-To: <20220413092206.73974-2-jvgediya@linux.ibm.com> References: <20220413092206.73974-1-jvgediya@linux.ibm.com> <20220413092206.73974-2-jvgediya@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=lu5MZDz+; spf=none (imf02.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 192.55.52.93) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: E07BA80006 X-Stat-Signature: snmzk3pxgczbj3uorz85idta3t4kyo64 X-HE-Tag: 1649920188-806973 X-Bogosity: Ham, tests=bogofilter, spamicity=0.022521, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, 2022-04-13 at 14:52 +0530, Jagdish Gediya wrote: > Sharing used_targets between multiple nodes in a single > pass limits some of the opportunities for demotion target > sharing. > > Don't share the used targets between multiple nodes in a > single pass, instead accumulate all the used targets in > source nodes shared by all pass, and reset 'used_targets' > to source nodes while finding demotion targets for any new > node. > > This results into some more opportunities to share demotion > targets between multiple source nodes, e.g. with below NUMA > topology, where node 0 & 1 are cpu + dram nodes, node 2 & 3 > are equally slower memory only nodes, and node 4 is slowest > memory only node, > > available: 5 nodes (0-4) > node 0 cpus: 0 1 > node 0 size: n MB > node 0 free: n MB > node 1 cpus: 2 3 > node 1 size: n MB > node 1 free: n MB > node 2 cpus: > node 2 size: n MB > node 2 free: n MB > node 3 cpus: > node 3 size: n MB > node 3 free: n MB > node 4 cpus: > node 4 size: n MB > node 4 free: n MB > node distances: > node 0 1 2 3 4 >   0: 10 20 40 40 80 >   1: 20 10 40 40 80 >   2: 40 40 10 40 80 >   3: 40 40 40 10 80 >   4: 80 80 80 80 10 > > The existing implementation gives below demotion targets, > > node demotion_target >  0 3, 2 >  1 4 >  2 X >  3 X >  4 X > > With this patch applied, below are the demotion targets, > > node demotion_target >  0 3, 2 >  1 3, 2 >  2 4 >  3 4 >  4 X > > e.g. with below NUMA topology, where node 0, 1 & 2 are > cpu + dram nodes and node 3 is slow memory node, > > available: 4 nodes (0-3) > node 0 cpus: 0 1 > node 0 size: n MB > node 0 free: n MB > node 1 cpus: 2 3 > node 1 size: n MB > node 1 free: n MB > node 2 cpus: 4 5 > node 2 size: n MB > node 2 free: n MB > node 3 cpus: > node 3 size: n MB > node 3 free: n MB > node distances: > node 0 1 2 3 >   0: 10 20 20 40 >   1: 20 10 20 40 >   2: 20 20 10 40 >   3: 40 40 40 10 > > The existing implementation gives below demotion targets, > > node demotion_target >  0 3 >  1 X >  2 X >  3 X > > With this patch applied, below are the demotion targets, > > node demotion_target >  0 3 >  1 3 >  2 3 >  3 X > With the [PATCH v1], you have describe the demotion order changes for the following system, I guess there's no change with [PATCH v2]? With below NUMA topology, where node 0 & 2 are cpu + dram nodes and node 1 & 3 are slow memory nodes, available: 4 nodes (0-3) node 0 cpus: 0 1 node 0 size: n MB node 0 free: n MB node 1 cpus: node 1 size: n MB node 1 free: n MB node 2 cpus: 2 3 node 2 size: n MB node 2 free: n MB node 3 cpus: node 3 size: n MB node 3 free: n MB node distances: node 0 1 2 3 0: 10 40 20 80 1: 40 10 80 80 2: 20 80 10 40 3: 80 80 40 10 And, what is the demotion order for the following system with [PATCH v2]? Node 0 & 2 are cpu + dram nodes and node 1 are slow memory node near node 0, available: 3 nodes (0-2) node 0 cpus: 0 1 node 0 size: n MB node 0 free: n MB node 1 cpus: node 1 size: n MB node 1 free: n MB node 2 cpus: 2 3 node 2 size: n MB node 2 free: n MB node distances: node 0 1 2 0: 10 40 20 1: 40 10 80 2: 20 80 10 Best Regards, Huang, Ying [snip]