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 781C3C433FE for ; Thu, 14 Apr 2022 08:57:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F02616B0071; Thu, 14 Apr 2022 04:57:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EB2AB6B0073; Thu, 14 Apr 2022 04:57:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D798A6B0074; Thu, 14 Apr 2022 04:57:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0181.hostedemail.com [216.40.44.181]) by kanga.kvack.org (Postfix) with ESMTP id C87A46B0071 for ; Thu, 14 Apr 2022 04:57:13 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7A642A89C4 for ; Thu, 14 Apr 2022 08:57:13 +0000 (UTC) X-FDA: 79354880346.28.5F16847 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by imf11.hostedemail.com (Postfix) with ESMTP id 632CD40007 for ; Thu, 14 Apr 2022 08:57:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649926632; x=1681462632; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=tLaRkQDxia82zDYbjT8YtujxT1/TuK3a5kx+Pr2IB8w=; b=Sd/C3SHxoDTnxBSc6fCYSPLhNJLzQQzbqPu3ESQ9zQ69fdAaEsLqr4X7 CXX5fIhryKlmWyZ4Reqt5ZwHon/8TOnuIdHdQHK2qnx1Dk2a4W+DOA5hq ihuviwAV4YyMFYjjWcE57fb0MUTbKck0Ra7y3eBkM3KrhyVDpq/3TEQch 74FVaE5rCsO8Gx3hEqToLzaXTO734m3Kj2f2sjmrxOsXWqyP9DBGVx4aU njeacDqU/xi3Y6hbmPIJJQ5z/V5WiwWX70DACxoR3eXeCVsEDERfJUXVy i+crulgFoHX+7mDvER88JckjZK71MGeXzz2+4IpAtEc53FFRCTNJhrZ96 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10316"; a="287939276" X-IronPort-AV: E=Sophos;i="5.90,259,1643702400"; d="scan'208";a="287939276" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2022 01:57:10 -0700 X-IronPort-AV: E=Sophos;i="5.90,259,1643702400"; d="scan'208";a="573682710" Received: from xikunjia-mobl1.ccr.corp.intel.com ([10.254.215.168]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2022 01:57:08 -0700 Message-ID: Subject: Re: [PATCH v2 1/5] mm: demotion: Set demotion list differently From: "ying.huang@intel.com" To: Jagdish Gediya Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, aneesh.kumar@linux.ibm.com, baolin.wang@linux.alibaba.com, dave.hansen@linux.intel.com Date: Thu, 14 Apr 2022 16:57:04 +0800 In-Reply-To: References: <20220413092206.73974-1-jvgediya@linux.ibm.com> <20220413092206.73974-2-jvgediya@linux.ibm.com> <4288cbad49690d7c4eb2b1d705eea01221ab8328.camel@intel.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="Sd/C3SHx"; spf=none (imf11.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 192.55.52.88) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Stat-Signature: k7tqrfj487hq8abupof7ghqgjfccfj8h X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 632CD40007 X-HE-Tag: 1649926632-151410 Content-Transfer-Encoding: quoted-printable 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 Thu, 2022-04-14 at 14:18 +0530, Jagdish Gediya wrote: > On Thu, Apr 14, 2022 at 03:09:42PM +0800, ying.huang@intel.com wrote: > > 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. > > >=20 > > > 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. > > >=20 > > > 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, > > >=20 > > > 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 > > > =C2=A0=C2=A00: 10 20 40 40 80 > > > =C2=A0=C2=A01: 20 10 40 40 80 > > > =C2=A0=C2=A02: 40 40 10 40 80 > > > =C2=A0=C2=A03: 40 40 40 10 80 > > > =C2=A0=C2=A04: 80 80 80 80 10 > > >=20 > > > The existing implementation gives below demotion targets, > > >=20 > > > node demotion_target > > > =C2=A00 3, 2 > > > =C2=A01 4 > > > =C2=A02 X > > > =C2=A03 X > > > =C2=A04 X > > >=20 > > > With this patch applied, below are the demotion targets, > > >=20 > > > node demotion_target > > > =C2=A00 3, 2 > > > =C2=A01 3, 2 > > > =C2=A02 4 > > > =C2=A03 4 > > > =C2=A04 X > > >=20 > > > e.g. with below NUMA topology, where node 0, 1 & 2 are > > > cpu + dram nodes and node 3 is slow memory node, > > >=20 > > > 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 > > > =C2=A0=C2=A00: 10 20 20 40 > > > =C2=A0=C2=A01: 20 10 20 40 > > > =C2=A0=C2=A02: 20 20 10 40 > > > =C2=A0=C2=A03: 40 40 40 10 > > >=20 > > > The existing implementation gives below demotion targets, > > >=20 > > > node demotion_target > > > =C2=A00 3 > > > =C2=A01 X > > > =C2=A02 X > > > =C2=A03 X > > >=20 > > > With this patch applied, below are the demotion targets, > > >=20 > > > node demotion_target > > > =C2=A00 3 > > > =C2=A01 3 > > > =C2=A02 3 > > > =C2=A03 X > > >=20 > >=20 > > With the [PATCH v1], you have describe the demotion order changes for > > the following system, I guess there's no change with [PATCH v2]? >=20 > Yes, there is no change with v2. >=20 > > With below NUMA topology, where node 0 & 2 are cpu + dram > > nodes and node 1 & 3 are slow memory nodes, > >=20 > > 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 > > =C2=A0=C2=A00: 10 40 20 80 > > =C2=A0=C2=A01: 40 10 80 80 > > =C2=A0=C2=A02: 20 80 10 40 > > =C2=A0=C2=A03: 80 80 40 10 > >=20 > > And, what is the demotion order for the following system with [PATCH > > v2]? > >=20 > > Node 0 & 2 are cpu + dram nodes and node 1 are slow > > memory node near node 0, > >=20 > > 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 > > =C2=A0=C2=A00: 10 40 20 > > =C2=A0=C2=A01: 40 10 80 > > =C2=A0=C2=A02: 20 80 10 >=20 > node 1 is demotion target for both node 0 and node 2 with this patch. > node 1 is demotion target only for node 0 with existing implementation, > however if node 1 is near to node 2 instead of node 0, still existing > implementation will give node 1 as demotion target only for node 0 whic= h > is not the correct behavior. >=20 > for both the scenario, with this patch applied, node 1 will be demotion > target for both 0 and 2. >=20 Sounds good! Thanks. Acked-by: "Huang, Ying" > > Best Regards, > > Huang, Ying > >=20 > >=20 > > [snip] > >=20 > >=20 > >=20 > Best regards, > Jagdish