Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1327155pxu; Fri, 16 Oct 2020 09:14:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGSOHnWIxFZFGUsCg8RbINAvPM3OxBOiYZNH4WQzWCrOKLcmFUUBQoYx7Vc+DfAvcjLClE X-Received: by 2002:a19:7509:: with SMTP id y9mr1571813lfe.306.1602864892510; Fri, 16 Oct 2020 09:14:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602864892; cv=none; d=google.com; s=arc-20160816; b=KwIgVG8YrFO3n52hlZ0nOtxNRlamANNrXeMLNfmg5lYqa8JhYR0qW0Lw4l/NZpp7NI kPxKPEv+l787ScSvTa2dwXbWUTphDtuBp2DYnc1A1lB/9qQd5fMaBHppLY7NA54ceKLc CZHLNWUhtriIx3fKUqf2c2XEoFagZREdXQHfSo5bNKG9S+Zj2QYcWUIIb1UizXpmRqTU ePiDr973nhsc569+GpP6AG2mzS0gqSBOtkq9GI/rBGxcQ0mOEde+kCfTbmay6WHRzUkr BK8k/U/Veiyq/46mfArJsymuIvb3oGQRv4iTX5eRoxV/PjBxd+lQbb47K2gJx6H6F+wI tpNg== 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=S69uDUZXWbvbCYIOqbJu91yuUjzpa+8gFiQ7g02vcYA=; b=ij3XxvnhGKvZEjKI9+EcTNibcu67CWA3oWSCx4HHBGIZ5JKlUbCPyvptAbYMe+2WHg mReAwFlQ6QHBAysq2m0DU2nndq2VBJ8ucP5k0UIo3Nvsop9IWFxOOD1x57FBrXw9Hlp+ NMUaKaokZkCDua21yChTWE/C0KTvv3eKZqz8TWsElVJY10lrco04vxlkcDnGo2cVRWhb wyr7UeQgJqN9SY5I9Yv5LS4EcgypZm+3D/rTDbN55G/OnR0l1r41jhH2CeEZfF3+uLS6 /pW1kMbIBlnSZHCHIvuSZw1oZGPrejJeP1MSFdtqQhwJGrOrHUlm90LU1yM8Ib2bODbS o4SQ== 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 c22si1918077edn.93.2020.10.16.09.14.27; Fri, 16 Oct 2020 09:14:52 -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 S2409834AbgJPPOR (ORCPT + 99 others); Fri, 16 Oct 2020 11:14:17 -0400 Received: from mga07.intel.com ([134.134.136.100]:10047 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2395540AbgJPPOQ (ORCPT ); Fri, 16 Oct 2020 11:14:16 -0400 IronPort-SDR: 2DizwvBUhuWmJ8EyQBSdx4z8c408FNlxtJmDQLPXlQOLaYn7eYhD4G1Q+Ojd3eRzW2bDaVJKlB ykZ/Bq+T7IaQ== X-IronPort-AV: E=McAfee;i="6000,8403,9776"; a="230817975" X-IronPort-AV: E=Sophos;i="5.77,383,1596524400"; d="scan'208";a="230817975" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2020 08:14:13 -0700 IronPort-SDR: FIF5WfCWETsAWReYXNH+IIVmcS0AuT+c154fIAwTkaCjCiLGCgs3vaP9O/ffQx6b5mKKrZqUTJ Afvm+IYQUmPw== X-IronPort-AV: E=Sophos;i="5.77,383,1596524400"; d="scan'208";a="531752068" Received: from ddalessa-mobl.amr.corp.intel.com (HELO [10.254.202.122]) ([10.254.202.122]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2020 08:14:11 -0700 Subject: Re: [PATCH] IB/hfi1: Avoid allocing memory on memoryless numa node To: Jason Gunthorpe Cc: Xianting Tian , mike.marciniszyn@cornelisnetworks.com, dledford@redhat.com, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org References: <20201010085732.20708-1-tian.xianting@h3c.com> <9ba33073-044c-9da6-a90d-4626e6441793@cornelisnetworks.com> <20201016141152.GC36674@ziepe.ca> From: Dennis Dalessandro Message-ID: Date: Fri, 16 Oct 2020 11:14:09 -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: <20201016141152.GC36674@ziepe.ca> 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/16/2020 10:11 AM, Jason Gunthorpe wrote: > On Mon, Oct 12, 2020 at 08:36:57AM -0400, Dennis Dalessandro wrote: >> 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 >>> +++ 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? > > Yikes, that is strongly discouraged. Hmm. This was never raised as an issue before. Regardless I can't recall why we did this in the first place. I'll do some digging, try to jog my memory. -Denny