Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp117056iof; Sun, 5 Jun 2022 22:53:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7dOATfTtCPkH17j1hz4pynlaxOfKNlvnRKTVfe3+Q6zwRWNRSVserydQ/l9u4RSO7N9et X-Received: by 2002:a17:90a:e7c7:b0:1e6:8093:3fc2 with SMTP id kb7-20020a17090ae7c700b001e680933fc2mr24273907pjb.7.1654494802504; Sun, 05 Jun 2022 22:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654494802; cv=none; d=google.com; s=arc-20160816; b=p/gKc2Y15/nrqt59C02WKnswtCAMLVsqNg/MC4K3+p2dZDChzsfAqTMMBwOOGf2CVC JdMNvnF+fyEkIl2cb5zckDliCa73GJdL4ulUlsWxOBaMHH+YC2vn1Wg4OBTe+WVCyhrW zh5BTs2tOSudK8ZKHzsUDHXZTfNrGBkAhd6RTGI+xzk/xOUyppGNT1u+jmsy74hC0fXc G1QFOTU9R8Eqd0rFClsYLNe+0EfsvDLmGiJy4iCf1mLT1uWUU7AMdY2tha1dzC0uUSvO ql4Uz9ZK7g1radhmwMeV62i6vTWC1zcXcvsg1uXUPpTB9OJmzbnILeXGuADyIjUNgKtC vgVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=odYJT9wDTwM8esokCC57v6EEdK2hi4NI6MpKa0Pf9vQ=; b=m4lrJYZ4hZ5Y4NLIDrQlXMEtQcYcpt9aRfK9qCkfGxhLcLgKY3ntxFGldYRcEhyOd/ 5XnefRuz978jOZAFaQZIG39M9f3FK+3a6jOc2ZoCHjQv4hvG25AbCNh9E1LCl0+lsnfQ SzsryjT7Ok0oMOx6RinYvYkQaUOyENLNG0A165rhDOwmqZRJiWesRBS39nUeiIGMZ8vp QxneTd+XCFmfJs8CtEiA2gki3Yh531yt59XeLtKGEpTg7AchZsJOW/eZ9bz9/AgKCR8X BojRY7rCt8E9PSX7rzTMVBXaWgTPyD2PaxrrqVoTyGgyawVsbgy2qLHokQXOVRRSe8Ra jOYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YcGrJvhW; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id bf1-20020a170902b90100b00161e5dcc680si5762609plb.358.2022.06.05.22.53.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 22:53:22 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YcGrJvhW; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6733A326; Sun, 5 Jun 2022 21:41:54 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349246AbiFFDLg (ORCPT + 99 others); Sun, 5 Jun 2022 23:11:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233098AbiFFDLd (ORCPT ); Sun, 5 Jun 2022 23:11:33 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C31ED4F460 for ; Sun, 5 Jun 2022 20:11:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654485091; x=1686021091; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=I0QdHF0IW1vsI3ZsPfW1ZXjzy87HEMICXcGVm9Da8ds=; b=YcGrJvhWHxe7TLmXKZ53x8003e4CGbBg/6rAlCaN4ahRSwv07A91n3Ty KLcT9LsKRYZumz1csuAsyIHXamky2TlcYPKjTX5ENI5ZbM3xl09UAuhNF Cwc7xNHNAVFC/B/BHS0zSCJFZ6CAu+bldTxpOlKO4F9F7286cf5Yu00J6 Dpx0Rttw8O6KTGHoj3XIT69vGycUayxGrYox5NZl0WwdsImkKREwweWzB 8TN8CEMLvCufNRFQ6lkwmDhfY+9LHlDCgW7j/EWoPcORwqTeBNOW5ARA4 9/rZ6Lp7gsapQ8NEAW+G8Bf1rwX2WIkEoZRbExWXgeTX+sgdsN6VlGvBn w==; X-IronPort-AV: E=McAfee;i="6400,9594,10369"; a="274153848" X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="274153848" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2022 20:11:31 -0700 X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="635369779" Received: from xingguom-mobl.ccr.corp.intel.com ([10.254.213.116]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2022 20:11:26 -0700 Message-ID: <6e94b7e2a6192e4cacba1db3676b5b5cf9b98eac.camel@intel.com> Subject: Re: [PATCH v5 9/9] mm/demotion: Update node_is_toptier to work with memory tiers From: Ying Huang To: "Aneesh Kumar K.V" , linux-mm@kvack.org, akpm@linux-foundation.org Cc: Wei Xu , Greg Thelen , Yang Shi , Davidlohr Bueso , Tim C Chen , Brice Goglin , Michal Hocko , Linux Kernel Mailing List , Hesham Almatary , Dave Hansen , Jonathan Cameron , Alistair Popple , Dan Williams , Feng Tang , Jagdish Gediya , Baolin Wang , David Rientjes Date: Mon, 06 Jun 2022 11:11:23 +0800 In-Reply-To: <20220603134237.131362-10-aneesh.kumar@linux.ibm.com> References: <20220603134237.131362-1-aneesh.kumar@linux.ibm.com> <20220603134237.131362-10-aneesh.kumar@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2022-06-03 at 19:12 +0530, Aneesh Kumar K.V wrote: > With memory tiers support we can have memory on NUMA nodes > in the top tier from which we want to avoid promotion tracking NUMA > faults. Update node_is_toptier to work with memory tiers. To > avoid taking locks, a nodemask is maintained for all demotion > targets. All NUMA nodes are by default top tier nodes and as > we add new lower memory tiers NUMA nodes get added to the > demotion targets thereby moving them out of the top tier. Check the usage of node_is_toptier(), - migrate_misplaced_page() node_is_toptier() is used to check whether migration is a promotion. We can avoid to use it. Just compare the rank of the nodes. - change_pte_range() and change_huge_pmd() node_is_toptier() is used to avoid scanning fast memory (DRAM) pages for promotion. So I think we should change the name to node_is_fast() as follows, static inline bool node_is_fast(int node) { return NODE_DATA(node)->mt_rank >= MEMORY_RANK_DRAM; } And, as above, I suggest to add memory tier ID and rank to struct pglist_data directly. Best Regards, Huang, Ying