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,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 2F6D7C0650E for ; Mon, 1 Jul 2019 12:52:02 +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 B107720B7C for ; Mon, 1 Jul 2019 12:52:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B107720B7C 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 45cnM310sKzDqWc for ; Mon, 1 Jul 2019 22:51:59 +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 45cnFh5DttzDqWv for ; Mon, 1 Jul 2019 22:47:20 +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 B8ACFAEF5; Mon, 1 Jul 2019 12:47:17 +0000 (UTC) Date: Mon, 1 Jul 2019 14:47:17 +0200 From: Michal Hocko To: David Hildenbrand Subject: Re: [PATCH v3 03/11] s390x/mm: Implement arch_remove_memory() Message-ID: <20190701124717.GU6376@dhcp22.suse.cz> References: <20190527111152.16324-1-david@redhat.com> <20190527111152.16324-4-david@redhat.com> <20190701074503.GD6376@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190701074503.GD6376@dhcp22.suse.cz> 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 01-07-19 09:45:03, Michal Hocko wrote: > 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?) Same as the previous patch (drop it). > > 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 -- Michal Hocko SUSE Labs