Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1037321ybt; Wed, 8 Jul 2020 19:07:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNNWR27793zR0bAEmJNl94qL0S/p5hfuQLtNctAsyfUdWEB2lmku0piPE0XvkPT0P0ph1h X-Received: by 2002:a50:e14e:: with SMTP id i14mr66984335edl.279.1594260462465; Wed, 08 Jul 2020 19:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594260462; cv=none; d=google.com; s=arc-20160816; b=U6pfQCpjEw9aYv8+ck+Vd5EF8SkHdybgUaT0cXlbUv/YSl2CL4pYlObKfdMqeWEs6U IvVHupSSNh6TPL1JEpH/BLTrfnnxMEyqveD8QSPLPoaRviziKPtmVb7tOo0u0TzQyn1R 7kPwPZXL4GETeot9FtSfiX7DWo4xdK+6CX5smaJcoAvjId/00aKGbzJXsI/ix9vnmQt7 07HmipQMjdCCyTkx3IvvS3CriUXHpzGJzZsa2fN0QORGeOfI1ymWmbcC5xVVbiaJLjGG Um3+viJWPvjmpHZuo/u8B4dW5oHd7SWHtKZCeIZ/vUJaJ/FjNBEw9n6f1PKpg/BHQlbF OOhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=sf0Z+BVEZHDGOc5TSJpDS4VDycZZENQxcugyTyLfG1Q=; b=oJdIG9Fj5zFaZASWM8/PIple7+MaYGvaBr2WqiKSClJ/4rwJaU1UqDBevshx5uCryC SikC2fHVdlBhSDAiGwn/KSAkhNH4q3imUJreorGRpEQOfn5RhsDMv+1qhN9LIIqHkRWF JWBY4JOJdU4F2pJyfxlbGv7skCzrycO1AU5FZwiYsnbC2sCjFdYeMl1QC3IW2XJ59tPh srmMFQAFIX1OMP/nqguD/T1d2sX9xVXap9/QXJJl+n7oNJPnyBEvxTyXzlybP/XttJuG GvGBloloXNeMH8eFYRrAcVCZNsn/QNMFQch6sqsILqjgR1UviuySMrbCyz3WrpwoLZtN hRyg== 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 gg21si1018543ejb.694.2020.07.08.19.07.18; Wed, 08 Jul 2020 19:07:42 -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 S1726247AbgGICG5 (ORCPT + 99 others); Wed, 8 Jul 2020 22:06:57 -0400 Received: from foss.arm.com ([217.140.110.172]:52420 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726072AbgGICG4 (ORCPT ); Wed, 8 Jul 2020 22:06:56 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5D82F1045; Wed, 8 Jul 2020 19:06:56 -0700 (PDT) Received: from localhost.localdomain (entos-thunderx2-02.shanghai.arm.com [10.169.212.213]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0FF5D3F887; Wed, 8 Jul 2020 19:06:46 -0700 (PDT) From: Jia He To: Catalin Marinas , Will Deacon , Tony Luck , Fenghua Yu , Yoshinori Sato , Rich Felker , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , David Hildenbrand Cc: x86@kernel.org, "H. Peter Anvin" , Dan Williams , Vishal Verma , Dave Jiang , Andrew Morton , Baoquan He , Chuhong Yuan , Mike Rapoport , Logan Gunthorpe , Masahiro Yamada , Michal Hocko , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, linux-nvdimm@lists.01.org, linux-mm@kvack.org, Jonathan Cameron , Kaly Xin , Jia He Subject: [PATCH v3 1/6] mm/memory_hotplug: introduce default dummy memory_add_physaddr_to_nid() Date: Thu, 9 Jul 2020 10:06:24 +0800 Message-Id: <20200709020629.91671-2-justin.he@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200709020629.91671-1-justin.he@arm.com> References: <20200709020629.91671-1-justin.he@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is to introduce a general dummy helper. memory_add_physaddr_to_nid() is a fallback option to get the nid in case NUMA_NO_NID is detected. After this patch, arm64/sh/s390 can simply use the general dummy version. PowerPC/x86/ia64 will still use their specific version. Signed-off-by: Jia He --- mm/memory_hotplug.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index da374cd3d45b..b49ab743d914 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -350,6 +350,16 @@ int __ref __add_pages(int nid, unsigned long pfn, unsigned long nr_pages, return err; } +#ifdef CONFIG_NUMA +int __weak memory_add_physaddr_to_nid(u64 start) +{ + pr_info_once("Unknown target node for memory at 0x%llx, assuming node 0\n", + start); + return 0; +} +EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); +#endif + /* find the smallest valid pfn in the range [start_pfn, end_pfn) */ static unsigned long find_smallest_section_pfn(int nid, struct zone *zone, unsigned long start_pfn, -- 2.17.1