Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp211158lqo; Thu, 16 May 2024 04:16:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVE6ND4fIM/q26BpkxEBIpQ+57byJoKDAYGvY5C43pWygVnBqNPjMYEetaiy8GazmjvXjW1E3tgWlMO80135D9Kx/KGUVtxUSDHwTau0g== X-Google-Smtp-Source: AGHT+IFmQORBhx11a2+irKhgQ3CYRz4ZFQmYfPf83Ny2w2xdCmFJHrO25AV4yucNPdYZGz+c9hOT X-Received: by 2002:a05:6a21:191:b0:1af:a5b1:2907 with SMTP id adf61e73a8af0-1afde0a9914mr23404677637.3.1715858176227; Thu, 16 May 2024 04:16:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715858176; cv=pass; d=google.com; s=arc-20160816; b=gE+Eulaig1vClpWzeEghBByHSjXOH5CyWKdaGsIMi1FGBjhr+OshMvJBxB97JQ3WYB mOPaU4opkuKwJQeDtc2mTuZrSciTY5z2cdGeOk5gy+fwsYwZvJ7kBpbUSnjH2ZXDGWqc fwTSNG7CW4/aHErdw0BA7gzJhPbLpX7Xobasccc9h8tf1jqF/wiHmusXv+PZmSvC5VmJ njnoJSEX9EMnczVNCY/GoOgQNA3QZidN6vNZ3rdjZhub13fasRMi5s39GEtYTLTKomut yoA7SatjOhtgBzrvzLBncuopLHkJehappHH/ntC/1HiRajIq3EInWKdUL3hAtE7CHVqW V6aA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:cc:to:subject:tls-required:message-id:from :content-transfer-encoding:date:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=JLeSRS3quX4ZlkgzdAPYMzk5VTg8+XdQRte0NfGmRLA=; fh=7Uz2SgsOdTQYcC/KQKFTd1kYMqq6KrsYdvIMUJsCI8Q=; b=vUUKGwTwDBgXN01PB9k7RQAGvkc0+SxjZMsOkhzhtE4s6/vJK/rMtVKQ41QBFmBgxu Wn6HJu3VBSzmQ6AIqlw5sbLI4EINlFKDKA1TACoUy8Sb7bshj8mkoXiS+cGWE2biUFA7 vE3cBz5HUuJtndOFlTwlRenXp+WjFdj78OZtP6LsWI6zCaNfiKHc8Ut5JkXrO53Tdsdf OfRRtBrcD2AuTXYu+61qaZ1o4EW45G0+XYWzFI/6zD8fAxL1CjppG9807RTp0lLutcvt gwEVdzp8s6afXPdnmuaD7uK4JwPBkeczoiZuC0O962m04wKSuCPQ0q6QfL/9pvoTZwUR iM3A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=qOj+Pk4m; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-180931-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180931-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6589778ca64si1753037a12.107.2024.05.16.04.16.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 04:16:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180931-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=qOj+Pk4m; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-180931-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180931-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B8F3028415C for ; Thu, 16 May 2024 11:16:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 33C921459E5; Thu, 16 May 2024 11:16:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="qOj+Pk4m" Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [95.215.58.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0701145350 for ; Thu, 16 May 2024 11:16:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715858170; cv=none; b=U+LGUsaIgoo9Y7djkabSxvrfLYpmWgk1dCSq4zURd/qvVSvGouZDKZ8FdVEjkpGygjZT4KHOlTxcg2JnTL92NzEO5NqGCNaXOniYsjT8OXWL/Mr1DLypcBUMm2MdPDEbGfVVDnixGOHVxxfc4laESKHGrJC2BAHY5sYeD44ybN0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715858170; c=relaxed/simple; bh=OB7JAvMeIimxmVIdIIm0ayzHuZaHOX29FQ00F2p1ZIA=; h=MIME-Version:Date:Content-Type:From:Message-ID:Subject:To:Cc: In-Reply-To:References; b=TDq2999vNg6+3JQvgDkSCaUOdM4tnJic6IeIMLlY6wp4SC4iPU/dB08d0MWH4rs/Kz4EQhKNFFZRsA/iMzUuU9fNOyW3RYbIjEALCaz9z8xspYghxt5zGcbeZc3Li6q+R0XfjhNo6uaAik8h/rXSsTqR4flEWdpR2e+ajwMJnck= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=qOj+Pk4m; arc=none smtp.client-ip=95.215.58.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: wangkefeng.wang@huawei.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1715858166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JLeSRS3quX4ZlkgzdAPYMzk5VTg8+XdQRte0NfGmRLA=; b=qOj+Pk4mcfUGWn7xkvKGJBmWnGR3HzgqOzbDB+kKCA5fVuBnOHvvOMmroddBtoDwCYqGvP wdpnWeRBsj9aPvkAz2QuNiOc5Pq8wZzDmCGJSl3xuGlOo4Cu5NA4AqO6U2ZaKoaIEvTbXz eJJ5KE6OxxCj5kktHMv1L81heiVJwlg= X-Envelope-To: akpm@linux-foundation.org X-Envelope-To: linux-mm@kvack.org X-Envelope-To: linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Thu, 16 May 2024 11:16:05 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Yajun Deng" Message-ID: TLS-Required: No Subject: Re: [PATCH] mm/cma: get nid from physical address To: "Kefeng Wang" , akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org In-Reply-To: <1d38aa26-cd2f-4330-9dcc-6c379cecb83b@huawei.com> References: <20240516091701.1527002-1-yajun.deng@linux.dev> <1d38aa26-cd2f-4330-9dcc-6c379cecb83b@huawei.com> X-Migadu-Flow: FLOW_OUT May 16, 2024 at 6:03 PM, "Kefeng Wang" wrote= : >=20 >=20On 2024/5/16 17:17, Yajun Deng wrote: >=20 >=20>=20 >=20> The nid passed to cma_declare_contiguous_nid() may be NUMA_NO_NODE, > >=20 >=20> which is not the actual nid. To get the correct nid, we can get th= e nid > >=20 >=20> from physical address. > >=20 >=20 > Please check >=20 >=20https://lore.kernel.org/linux-riscv/47437c2b-5946-41c6-ad1b-cc03329eb= 230@huawei.com/ >=20 Okay,=20thanks! > >=20 >=20> Signed-off-by: Yajun Deng > >=20 >=20> --- > >=20 >=20> mm/cma.c | 1 + > >=20 >=20> 1 file changed, 1 insertion(+) > >=20 >=20> diff --git a/mm/cma.c b/mm/cma.c > >=20 >=20> index 3e9724716bad..be6cdde32944 100644 > >=20 >=20> --- a/mm/cma.c > >=20 >=20> +++ b/mm/cma.c > >=20 >=20> @@ -361,6 +361,7 @@ int __init cma_declare_contiguous_nid(phys_add= r_t base, > >=20 >=20> kmemleak_ignore_phys(addr); > >=20 >=20> base =3D addr; > >=20 >=20> } > >=20 >=20> + nid =3D early_pfn_to_nid(PHYS_PFN(base)); > >=20 >=20> > ret =3D cma_init_reserved_mem(base, size, order_per_bit, name, r= es_cma); > >=20 >=20> if (ret) > > >