From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF25FC0650E for ; Mon, 1 Jul 2019 07:47:09 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5DDB9208E4 for ; Mon, 1 Jul 2019 07:47:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5DDB9208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 45cfbG4tVDzDqY2 for ; Mon, 1 Jul 2019 17:47:06 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=softfail (mailfrom) smtp.mailfrom=kernel.org (client-ip=195.135.220.15; helo=mx1.suse.de; envelope-from=mhocko@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 45cfXz57PzzDqYB for ; Mon, 1 Jul 2019 17:45:07 +1000 (AEST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 9C66EAE48; Mon, 1 Jul 2019 07:45:04 +0000 (UTC) Date: Mon, 1 Jul 2019 09:45:03 +0200 From: Michal Hocko To: David Hildenbrand Subject: Re: [PATCH v3 03/11] s390x/mm: Implement arch_remove_memory() Message-ID: <20190701074503.GD6376@dhcp22.suse.cz> References: <20190527111152.16324-1-david@redhat.com> <20190527111152.16324-4-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190527111152.16324-4-david@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oscar Salvador , linux-s390@vger.kernel.org, linux-ia64@vger.kernel.org, Vasily Gorbik , linux-sh@vger.kernel.org, Heiko Carstens , linux-kernel@vger.kernel.org, Wei Yang , linux-mm@kvack.org, Mike Rapoport , Martin Schwidefsky , Igor Mammedov , akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org, Dan Williams , linux-arm-kernel@lists.infradead.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon 27-05-19 13:11:44, David Hildenbrand wrote: > Will come in handy when wanting to handle errors after > arch_add_memory(). I do not understand this. Why do you add a code for something that is not possible on this HW (based on the comment - is it still valid btw?) > 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 d552e330fbcc..14955e0a9fcf 100644 > --- a/arch/s390/mm/init.c > +++ b/arch/s390/mm/init.c > @@ -243,12 +243,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)); > + __remove_pages(zone, start_pfn, nr_pages, altmap); > + vmem_remove_mapping(start, size); > } > #endif > #endif /* CONFIG_MEMORY_HOTPLUG */ > -- > 2.20.1 > -- Michal Hocko SUSE Labs