From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hildenbrand Date: Fri, 26 Apr 2019 09:11:24 +0000 Subject: Re: [PATCH v1 2/7] s390x/mm: Implement arch_remove_memory() Message-Id: List-Id: References: <20190424102511.29318-1-david@redhat.com> <20190424102511.29318-3-david@redhat.com> In-Reply-To: <20190424102511.29318-3-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, akpm@linux-foundation.org, Dan Williams , Martin Schwidefsky , Heiko Carstens , Michal Hocko , Mike Rapoport , Vasily Gorbik , Oscar Salvador On 24.04.19 12:25, David Hildenbrand wrote: > Will come in handy when wanting to handle errors after > arch_add_memory(). > > Cc: Martin Schwidefsky > Cc: Heiko Carstens > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Mike Rapoport > Cc: David Hildenbrand > Cc: Vasily Gorbik > Cc: Oscar Salvador > Signed-off-by: David Hildenbrand > --- > arch/s390/mm/init.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c > index 31b1071315d7..2636d62df04e 100644 > --- a/arch/s390/mm/init.c > +++ b/arch/s390/mm/init.c > @@ -237,12 +237,13 @@ int arch_add_memory(int nid, u64 start, u64 size, > void arch_remove_memory(int nid, u64 start, u64 size, > struct vmem_altmap *altmap) > { > - /* > - * There is no hardware or firmware interface which could trigger a > - * hot memory remove on s390. So there is nothing that needs to be > - * implemented. > - */ > - BUG(); > + unsigned long start_pfn = start >> PAGE_SHIFT; > + unsigned long nr_pages = size >> PAGE_SHIFT; > + struct zone *zone; > + > + vmem_remove_mapping(start, size); > + zone = page_zone(pfn_to_page(start_pfn)); > + __remove_pages(zone, start_pfn, nr_pages, altmap); I guess the correct way is to remove the mapping after __remove_pages. But as the pages should not be touched by anybody, it shouldn't really matter. Will change when I resend. > } > #endif > #endif /* CONFIG_MEMORY_HOTPLUG */ > -- Thanks, David / dhildenb