Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp157495lqo; Thu, 16 May 2024 02:17:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUbvR9puA/xtDfSAmk2NTGbxxTC7kbaUfwOFsBxulTVSlcqqkKVWnqXg/GNJAz6xGzU3fTD7W6J+O+B2gm2Yr+39RHhpB0gSNU7+oetCQ== X-Google-Smtp-Source: AGHT+IHZ/5/4+173vu+zOZX+p4phz6WoY1Z9aW5ySpuz4jotoLydgkecpY/EiJfD8n9ZadUm8gnD X-Received: by 2002:a05:6830:1290:b0:6f0:6864:eee6 with SMTP id 46e09a7af769-6f0e911398fmr19990616a34.10.1715851060181; Thu, 16 May 2024 02:17:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715851060; cv=pass; d=google.com; s=arc-20160816; b=FK6jNtVrmw/qKNZn8HwBCd4E/gcnwUDdAPnl5G3TQYYtFnStF1nygDvLkDalAY2OB/ 3KuTZkIgdPMYPb8iLOUdaOgZITwFXkLCbEexMZiDrYg6TWBK2MTeVRNa38WXUc2S6QTh YXYYe4bJVDwNEjnSQgvaCTvGXnMIMRpECNbVRfKIGZFONN272E9d+GgUYQZpKGqI+gRt sGXac6BiL/T7Kq8pkPLbPoaemOyXWhXUV1isH0wH6uio2paU6SpZucYNuNNZNOSB79lR amNdDq88JBy1xOm8oKJtCYAC/PUEOzjLjXgqgzx/5p4SJiVyKvqbLeDyGcPIahL2XRgA EtjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=1JE4ANZQwE+LW47rs3NXLBhGDGN9Arjfv7ogeqT4+iU=; fh=KPJjYJHLC+uLVMTRQa7GdG2CYCH/otyIF0MYaE50dhE=; b=0MwirPgXJuvXBvEjzELQo77dApTK/xN5108fTo3fUVlVEEwtJpnmbJ6lNZiOWxCnr5 vYNTnvgJnTCYhEB7STiAjY82VmFihk6iLOdZe/bA6GQ68kXe3EOWfTypx7Ov/TVMDGF0 3MIxPuGYpPxSwGNBhHcY7+gv++f8YKJ3PwT4DlNRUXhIiMhSpUm+j2Tww9/JROXEdxzY LfMbOmNAXheL/1maBFs/vPID4vnEShM74MgE61Lp57T0Ido/2F2XTFOWUG8ZOzoya4i3 iWIqDzcTohSSv0n2STRRR7IdKcscK/5JwBfK4kU3M5zcVILRdCeTiFNNLZTrMyartjvG t/CQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=N5vEn36G; 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-180823-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180823-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-638b8059657si13432153a12.604.2024.05.16.02.17.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 02:17:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180823-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=N5vEn36G; 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-180823-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180823-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 9684B283DE9 for ; Thu, 16 May 2024 09:17:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA4E9143744; Thu, 16 May 2024 09:17:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="N5vEn36G" Received: from out-179.mta1.migadu.com (out-179.mta1.migadu.com [95.215.58.179]) (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 183682576F for ; Thu, 16 May 2024 09:17:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715851053; cv=none; b=lRs9fWTsLqalU/xVSI1bloy/W0XhMUG8dICLbgvws9gVvHd4HJcZr3Ye5yf6YsQ66Z1Pih9kWpor83RgGY1sM0b/ifiZfgFmiGSMln66FpCZnbZkAT3lxhXzoxn8sEIhkXKGNAtCpvH33Sapu/idFHxnZtTttPaG6DCCqFDkomY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715851053; c=relaxed/simple; bh=ZadexFFezC3w9+jlqieXCACzwn6JSoQIVLbDQKIm/g8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=YMEfvBeYZAUhGnoHYwL4xJZRLD7cjZzY3byjT0zDBmFk7OUldU6pXcygmc68FPosM/DO9lsXROQZ/GyPQwZnjG8uhRUpU174/g9+vlJ1oTxqBk2cv0GF0lVMPSPVK6CZfpEZztc0o0l5x485sXf5+OpW6hfz27cLR6YRPotLr+M= 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=N5vEn36G; arc=none smtp.client-ip=95.215.58.179 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: akpm@linux-foundation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1715851048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=1JE4ANZQwE+LW47rs3NXLBhGDGN9Arjfv7ogeqT4+iU=; b=N5vEn36GlKUMXfEFhLxYmSLhiJ5sNAFUYZpNcga0tulb+2RCQZJ0wf3bNNQAxUkGhTtVeE jDP0ROS9MdNnejnkjno2qknnYtavFvNGmrEOswmM0mxCgGTRrFEPBurLBTn5AmLFZinxcw dVzQCaKmbRu0XWc9P2y9zSw1j/kGaPg= X-Envelope-To: linux-mm@kvack.org X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: yajun.deng@linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yajun Deng To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yajun Deng Subject: [PATCH] mm/cma: get nid from physical address Date: Thu, 16 May 2024 17:17:01 +0800 Message-Id: <20240516091701.1527002-1-yajun.deng@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT The nid passed to cma_declare_contiguous_nid() may be NUMA_NO_NODE, which is not the actual nid. To get the correct nid, we can get the nid from physical address. Signed-off-by: Yajun Deng --- mm/cma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/cma.c b/mm/cma.c index 3e9724716bad..be6cdde32944 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -361,6 +361,7 @@ int __init cma_declare_contiguous_nid(phys_addr_t base, kmemleak_ignore_phys(addr); base = addr; } + nid = early_pfn_to_nid(PHYS_PFN(base)); ret = cma_init_reserved_mem(base, size, order_per_bit, name, res_cma); if (ret) -- 2.25.1