From patchwork Fri Jul 10 03:16:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia He X-Patchwork-Id: 11655575 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9877B6C1 for ; Fri, 10 Jul 2020 03:17:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6F05520767 for ; Fri, 10 Jul 2020 03:17:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F05520767 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B493D6B0005; Thu, 9 Jul 2020 23:17:32 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B1E076B0006; Thu, 9 Jul 2020 23:17:32 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E6886B0007; Thu, 9 Jul 2020 23:17:32 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0002.hostedemail.com [216.40.44.2]) by kanga.kvack.org (Postfix) with ESMTP id 886A56B0005 for ; Thu, 9 Jul 2020 23:17:32 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 412BB8248047 for ; Fri, 10 Jul 2020 03:17:32 +0000 (UTC) X-FDA: 77020705944.10.town71_170e2a926ecb Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 5E01716A4C8 for ; Fri, 10 Jul 2020 03:16:43 +0000 (UTC) X-Spam-Summary: 50,0,0,60533a7bc502b188,d41d8cd98f00b204,justin.he@arm.com,,RULES_HIT:41:69:355:379:541:967:968:973:988:989:1260:1261:1345:1437:1534:1541:1711:1730:1747:1777:1792:2194:2199:2393:2525:2565:2682:2685:2693:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3608:3865:3867:3868:3870:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4470:4605:5007:6261:6737:6742:6743:7875:8634:9025:10004:11026:11657:11658:11914:12043:12048:12296:12297:12438:12533:12679:12895:13069:13311:13357:14096:14181:14384:14394:14721:21080:21324:21451:21627:21788:30054,0,RBL:217.140.110.172:@arm.com:.lbl8.mailshell.net-64.201.201.201 62.14.0.100;04ygsg8qqg5cmdbb1mio4q4b4pgj6opahfdqsut9ty1os6eysg774nbq9xr74fu.rpnj6tjximpq5wnt6ze3xhmu87it98nz9pxsg9r4d9948d5omtnzeecupojtnub.q-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMA RY:none X-HE-Tag: town71_170e2a926ecb X-Filterd-Recvd-Size: 3657 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Fri, 10 Jul 2020 03:16:38 +0000 (UTC) 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 E923831B; Thu, 9 Jul 2020 20:16:37 -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 A22283F9AB; Thu, 9 Jul 2020 20:16:28 -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 v4 0/2] Fix and enable pmem as RAM device on arm64 Date: Fri, 10 Jul 2020 11:16:17 +0800 Message-Id: <20200710031619.18762-1-justin.he@arm.com> X-Mailer: git-send-email 2.17.1 X-Rspamd-Queue-Id: 5E01716A4C8 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This fixies a few issues when I tried to enable pmem as RAM device on arm64. To use memory_add_physaddr_to_nid as a fallback nid, it would be better implement a general version (__weak) in mm/memory_hotplug. After that, arm64/ sh/s390 can simply use the general version, and PowerPC/ia64/x86 will use arch specific version. Tested on ThunderX2 host/qemu "-M virt" guest with a nvdimm device. The memblocks from the dax pmem device can be either hot-added or hot-removed on arm64 guest. Also passed the compilation test on x86. Changes: v4: - remove "device-dax: use fallback nid when numa_node is invalid", wait for Dan Williams' phys_addr_to_target_node() patch - folder v3 patch1-4 into single one, no functional changes v3: https://lkml.org/lkml/2020/7/8/1541 - introduce general version memory_add_physaddr_to_nid, refine the arch specific one - fix an uninitialization bug in v2 device-dax patch v2: https://lkml.org/lkml/2020/7/7/71 - Drop unnecessary patch to harden try_offline_node - Use new solution(by David) to fix dev->target_node=-1 during probing - Refine the mem_hotplug_begin/done patch v1: https://lkml.org/lkml/2020/7/5/381 Jia He (2): mm/memory_hotplug: introduce default dummy memory_add_physaddr_to_nid() mm/memory_hotplug: fix unpaired mem_hotplug_begin/done arch/arm64/mm/numa.c | 10 ---------- arch/ia64/mm/numa.c | 2 -- arch/sh/mm/init.c | 9 --------- arch/x86/mm/numa.c | 1 - mm/memory_hotplug.c | 15 ++++++++++++--- 5 files changed, 12 insertions(+), 25 deletions(-)