Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4253552pxu; Mon, 12 Oct 2020 13:49:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwILc0gdY4OoNubhSSw1O1II80YaNMCK6gF0iUxVf5MJQBHTjHRCW7T9Uvftzh7InEInyHk X-Received: by 2002:a17:906:468c:: with SMTP id a12mr29063509ejr.269.1602535793748; Mon, 12 Oct 2020 13:49:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602535793; cv=none; d=google.com; s=arc-20160816; b=aOso4EXzIQfVHpj27nPKeLFgFz1MWeVuG0NaOm1GiRSi0aYkMWvkj6bNqBsLcqlXpL Vro8o29RIAWKlXYowoRh80Qg/LYO7P5c0RCceYg2DfNtrcjUVNU8q66D67+1U/K+zNnA GLCCEwUyf1S1Vvyu3VQwfwsI6car3KA8WTNS9kzpbLO+ZqGj8vFJmIovLa8Xi/pNApIi 7TDBHx//beDqwOzKL0lP1sFmqIJeLlguMBwiTgvnQTTxgf89cs6lz4Ar0ZL4dBIlv755 H6nnuY0/rq3+ayzAh8TvboJeacyet1tq0vjfCj9qhhDK8M0pXJMPJ0cu7XRm7iuXRAUe Bxsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=l7G4GoOVtJo37VMH2F6Xjm/VWNenPFoKLLw5fMmvwqY=; b=uBdJIjfxd0GTxD7TDXDLF0B7JvDn9QZtW4APAvV6vS6zrgmVTWMFISSR26Y6xqOJMu Te6sDd61mW6ORveGQ5tXa4DSAwPaz0NA2tUaP1CQ4UTqt+iFTeK1Ny8g+IogPLey3FGW Vtf/r8ZL74AFGE9qHrvAuxWpOSR7tU2c3TDhRRA5hWJCJV3HanQ0d+EM1luA0FMDNN/c Ze6tJbLD1YQx7UGaVKPgpufuvhrBozLSggMc7HeV/VXwyFLDaS+MOQdSrd+dCBVT9oym tjdT1uCbppouf1ouXH75t+lY0Uvw8VDcLu86LJiWTmXGRfNKtpB9XnpAihJDaCbic4ou 2EhQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gx5si13010738ejb.393.2020.10.12.13.49.31; Mon, 12 Oct 2020 13:49:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727057AbgJLMhC (ORCPT + 99 others); Mon, 12 Oct 2020 08:37:02 -0400 Received: from mga11.intel.com ([192.55.52.93]:39194 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726348AbgJLMhB (ORCPT ); Mon, 12 Oct 2020 08:37:01 -0400 IronPort-SDR: OR2bUKtcph/ao4WnueK4SiN3repoxYzBpqlQyOiEqNdKlvmqJjoKDxFAPjZmPp2CBk7X/SnUVQ L3q9UpSDk/sw== X-IronPort-AV: E=McAfee;i="6000,8403,9771"; a="162264369" X-IronPort-AV: E=Sophos;i="5.77,366,1596524400"; d="scan'208";a="162264369" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 05:37:01 -0700 IronPort-SDR: 1XoUDNBtzVcVscTXU97SkSUBX9lsh7d3oEWRdc/OOsaupeZ0VbRU50p0x2r5vDKTHCKzQTBLE4 Aut4qsodfQCQ== X-IronPort-AV: E=Sophos;i="5.77,366,1596524400"; d="scan'208";a="529937906" Received: from ddalessa-mobl.amr.corp.intel.com (HELO [10.254.201.99]) ([10.254.201.99]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 05:37:00 -0700 Subject: Re: [PATCH] IB/hfi1: Avoid allocing memory on memoryless numa node To: Xianting Tian , mike.marciniszyn@intel.com, dennis.dalessandro@intel.com, dledford@redhat.com, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org References: <20201010085732.20708-1-tian.xianting@h3c.com> From: Dennis Dalessandro Message-ID: <9ba33073-044c-9da6-a90d-4626e6441793@cornelisnetworks.com> Date: Mon, 12 Oct 2020 08:36:57 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <20201010085732.20708-1-tian.xianting@h3c.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/10/2020 4:57 AM, Xianting Tian wrote: > In architecture like powerpc, we can have cpus without any local memory > attached to it. In such cases the node does not have real memory. > > Use local_memory_node(), which is guaranteed to have memory. > local_memory_node is a noop in other architectures that does not support > memoryless nodes. > > Signed-off-by: Xianting Tian > --- > drivers/infiniband/hw/hfi1/file_ops.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/infiniband/hw/hfi1/file_ops.c b/drivers/infiniband/hw/hfi1/file_ops.c > index 8ca51e43c..79fa22cc7 100644 > --- a/drivers/infiniband/hw/hfi1/file_ops.c > +++ b/drivers/infiniband/hw/hfi1/file_ops.c > @@ -965,7 +965,7 @@ static int allocate_ctxt(struct hfi1_filedata *fd, struct hfi1_devdata *dd, > */ > fd->rec_cpu_num = hfi1_get_proc_affinity(dd->node); > if (fd->rec_cpu_num != -1) > - numa = cpu_to_node(fd->rec_cpu_num); > + numa = local_memory_node(cpu_to_node(fd->rec_cpu_num)); > else > numa = numa_node_id(); > ret = hfi1_create_ctxtdata(dd->pport, numa, &uctxt); > The hfi1 driver depends on X86_64. I'm not sure what this patch buys, can you expand a bit? -Denny