From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hildenbrand Date: Tue, 07 May 2019 20:47:41 +0000 Subject: Re: [PATCH v2 2/8] s390x/mm: Implement arch_remove_memory() Message-Id: <97a6a2ab-0e8b-d403-ca39-ffa4425e15a5@redhat.com> List-Id: References: <20190507183804.5512-1-david@redhat.com> <20190507183804.5512-3-david@redhat.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dan Williams Cc: Linux MM , Linux Kernel Mailing List , linux-ia64@vger.kernel.org, linuxppc-dev , linux-s390 , Linux-sh , Andrew Morton , Martin Schwidefsky , Heiko Carstens , Michal Hocko , Mike Rapoport , Vasily Gorbik , Oscar Salvador On 07.05.19 22:46, Dan Williams wrote: > On Tue, May 7, 2019 at 11:38 AM 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..1e0cbae69f12 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; >> + >> + zone = page_zone(pfn_to_page(start_pfn)); > > Does s390 actually support passing in an altmap? If 'yes', I think it > also needs the vmem_altmap_offset() fixup like x86-64: > > /* With altmap the first mapped page is offset from @start */ > if (altmap) > page += vmem_altmap_offset(altmap); > > ...but I suspect it does not support altmap since > arch/s390/mm/vmem.c::vmemmap_populate() does not arrange for 'struct > page' capacity to be allocated out of an altmap defined page pool. > > I think it would be enough to disallow any arch_add_memory() on s390 > where @altmap is non-NULL. At least until s390 gains ZONE_DEVICE > support and can enable the pmem use case. > As far as I know, it doesn't yet, however I guess this could change once virtio-pmem is supported? Thanks! -- Thanks, David / dhildenb