Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1271253lfc; Wed, 1 Jun 2022 13:45:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzj5rHT9g+hIH/jdDInxpOMl2zRXi3+7+oNe0RMtYNLhgXaSKSd5MV8sQpc4foLANRcI80o X-Received: by 2002:a17:90b:287:b0:1e3:45c9:9a93 with SMTP id az7-20020a17090b028700b001e345c99a93mr1322615pjb.80.1654116351196; Wed, 01 Jun 2022 13:45:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654116351; cv=none; d=google.com; s=arc-20160816; b=R4VAbxjzeQkun2YOIR04gT6d0WmVf4nc5vmTvUFeceTUshdxCLqjsjiiBCVfXo6KlZ 5gbbWdLR1INt8OTgFEAwbnqYMkaVMSrC7XLu9lq/Xqriv1bcNaNutBFNtW6tYGV8WL1E BbVJMiCVgoOeCc3GSFaf/CfTQQuTX9GqQdzx8hG2ExjGa4NgeCOckFR9O1YQfhC+cc04 o/G80O35VNO93Ii6dmrvXiH34aI6zH4Kwe4FvQs6JwLIAktMCJO0qdgrVIqxpi/gxiHm rotoIIMtOGxIiV/gWevOYcWgwrsLfpZofrJDp0482HdkGDceiBlaWEAQ8uUQaGIbD7K7 gWGw== 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=ucNqqlCDPfCEfUlfkYEV9JGPrex6Lv7pK3deB38Ueg4=; b=HGRrmyGU5vSCouDoY1ZEVGC8EmZSly+jQki/iI0sQ7U6fN8VdCgaCCiOuNCZrFKAtz asJZauMDpyVXYddv7vbdkxx3prCjGgIukuZnDgRS6hiiV6LLwvQRRBwdyLLX7CSekUVc YADDWyCTpRMJqZPzwcCeefCFs3iIAgYI2Z4Zda8UGtCZhPOzXd/1JYN6zFp9B/RfiGKv X/j98+8hJqHv5ofE++idlFZ9uKss6gOCnNQSyG+AAwoVuw8zb+DRKepihbZ0F9u1TxLZ jOe6Wi63IekPDSFQSs819OoIbBQPYRnHhLIgnYFZ8Nnrm03BpJpM9l2SrSCJBnmOOkpq Sf7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GH5EMaLP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j19-20020a635953000000b003aa7f30fcaasi3301390pgm.516.2022.06.01.13.45.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 13:45:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GH5EMaLP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 3AC412A5D45; Wed, 1 Jun 2022 12:53:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243632AbiFAGMb (ORCPT + 99 others); Wed, 1 Jun 2022 02:12:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238942AbiFAGMb (ORCPT ); Wed, 1 Jun 2022 02:12:31 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4140F554AA for ; Tue, 31 May 2022 23:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654063950; x=1685599950; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=ejk+xQ9b0k0wC9j8WfBHQoNfMzyyS5YZ0KCtVf4OBQw=; b=GH5EMaLPQFiM8BNsSkrnQdfqfrjAS76V8CwkAGFg7p1TpMAd9KXeVYsh jKhyCpCrl8yebMrb3RJG+D8GUAGcr0B/AiQYaAuz2mnW+9H6EJBN96JO7 DO+32BYeJDd1cR8L+epRnS7IMa1pfyztk4Mwa02sFbk5P05WvQe9AtW4D Bbi5aRb/vTCraLYdlDxB72xNZ5ol7b3Y8Lqx5Yr1aOZdtRuHJSk9BbY4+ 9NCYC5FmyW+RBzjX8MQWLOhqV5/IVHMXhuI3lSPyHdnqQWQAhA6+rpDa6 JUyc1V10uv3UEfb2RZQ7r9wta9zl/xAY3g+HfP9l3+F8l7i9X7j1jWbvo w==; X-IronPort-AV: E=McAfee;i="6400,9594,10364"; a="255962236" X-IronPort-AV: E=Sophos;i="5.91,266,1647327600"; d="scan'208";a="255962236" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 23:12:29 -0700 X-IronPort-AV: E=Sophos;i="5.91,266,1647327600"; d="scan'208";a="606087592" Received: from liangqiz-mobl.ccr.corp.intel.com ([10.254.214.157]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 23:12:25 -0700 Message-ID: <61c47f98b4c0be1d5da5e097779412f9edd70753.camel@intel.com> Subject: Re: [PATCH 2/6] mm/vmscan: use node_is_toptier helper in node_reclaim From: Ying Huang To: "Aneesh Kumar K.V" , Davidlohr Bueso , linux-mm@kvack.org, Wei Xu Cc: mhocko@kernel.org, akpm@linux-foundation.org, rientjes@google.com, yosryahmed@google.com, hannes@cmpxchg.org, shakeelb@google.com, dave.hansen@linux.intel.com, tim.c.chen@linux.intel.com, roman.gushchin@linux.dev, gthelen@google.com, a.manzanares@samsung.com, heekwon.p@samsung.com, gim.jongmin@samsung.com, linux-kernel@vger.kernel.org Date: Wed, 01 Jun 2022 14:12:22 +0800 In-Reply-To: <87h755dip9.fsf@linux.ibm.com> References: <20220416053902.68517-1-dave@stgolabs.net> <20220416053902.68517-3-dave@stgolabs.net> <87h755dip9.fsf@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-Spam-Status: No, score=-2.5 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 Tue, 2022-05-31 at 17:20 +0530, Aneesh Kumar K.V wrote: > Davidlohr Bueso writes: > > > We have helpers for a reason. > > > > Signed-off-by: Davidlohr Bueso > > --- > >  mm/vmscan.c | 2 +- > >  1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/mm/vmscan.c b/mm/vmscan.c > > index 1678802e03e7..cb583fcbf5bf 100644 > > --- a/mm/vmscan.c > > +++ b/mm/vmscan.c > > @@ -4750,7 +4750,7 @@ int node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned int order) > >   * over remote processors and spread off node memory allocations > >   * as wide as possible. > >   */ > > - if (node_state(pgdat->node_id, N_CPU) && pgdat->node_id != numa_node_id()) > > + if (node_is_toptier(pgdat->node_id) && pgdat->node_id != numa_node_id()) > >   return NODE_RECLAIM_NOSCAN; > >   > > > >   if (test_and_set_bit(PGDAT_RECLAIM_LOCKED, &pgdat->flags)) > > > Are we really looking at the top tier in a tiered memory hierarchy here? > The comment seems to suggest we are looking at local NUMA node? The code change itself is correct. But it is an implementation details that node_is_toptier() == node_state(, N_CPU). And after we supporting more memory tiers (like GPU, HBM), we will change the implementation of node_is_toptier() soon. So I think that it's better to keep the original code. Best Regards, Huang, Ying