From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [PATCH v2 3/8] mm/memory_hotplug: arch_remove_memory() and __remove_pages() with CONFIG_MEMORY_HOTPLUG From: David Hildenbrand References: <20190507183804.5512-1-david@redhat.com> <20190507183804.5512-4-david@redhat.com> Message-ID: Date: Mon, 13 May 2019 10:20:43 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: owner-linux-mm@kvack.org List-Archive: List-Post: To: Dan Williams , Michal Hocko , Oscar Salvador Cc: Linux MM , Linux Kernel Mailing List , linux-ia64@vger.kernel.org, linuxppc-dev , linux-s390 , Linux-sh , Andrew Morton , Tony Luck , Fenghua Yu , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Martin Schwidefsky , Heiko Carstens , Yoshinori Sato , Rich Felker , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Greg Kroah-Hartman , "Rafael J. Wysocki" , Mike Rapoport , "Kirill A. Shutemov" , Alex Deucher , "David S. Miller" , Mark Brown , Chris Wilson , Christophe Leroy , Nicholas Piggin , Vasily Gorbik , Rob Herring , Masahiro Yamada , "mike.travis@hpe.com" , Andrew Banman , Pavel Tatashin , Wei Yang , Arun KS , Qian Cai , Mathieu Malaterre , Baoquan He , Logan Gunthorpe List-ID: On 13.05.19 09:48, David Hildenbrand wrote: > On 07.05.19 23:02, Dan Williams wrote: >> On Tue, May 7, 2019 at 11:38 AM David Hildenbrand wrote: >>> >>> Let's prepare for better error handling while adding memory by allowing >>> to use arch_remove_memory() and __remove_pages() even if >>> CONFIG_MEMORY_HOTREMOVE is not set. CONFIG_MEMORY_HOTREMOVE effectively >>> covers >>> - Offlining of system ram (memory block devices) - offline_pages() >>> - Unplug of system ram - remove_memory() >>> - Unplug/remap of device memory - devm_memremap() >>> >>> This allows e.g. for handling like >>> >>> arch_add_memory() >>> rc = do_something(); >>> if (rc) { >>> arch_remove_memory(); >>> } >>> >>> Whereby do_something() will for example be memory block device creation >>> after it has been factored out. >> >> What's left after this? Can we just get rid of CONFIG_MEMORY_HOTREMOVE >> option completely when CONFIG_MEMORY_HOTPLUG is enabled? It's not >> clear to me why there was ever the option to compile out the remove >> code when the add code is included. >> > > If there are no other comments, I will go ahead and rip out > CONFIG_MEMORY_HOTREMOVE completely, gluing the functionality to > CONFIG_MEMORY_HOTPLUG. > Hmmmm, however this will require CONFIG_MEMORY_HOTPLUG to require - MEMORY_ISOLATION - HAVE_BOOTMEM_INFO_NODE if (X86_64 || PPC64) And depends on - MIGRATION Which would limit the configurations where memory hotplug would be available. I guess going with this patch here is ok as a first step. I just realized, that we'll need arch_remove_memory() for arm64 to make this patch here work. -- Thanks, David / dhildenb