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=-6.7 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS 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 C3475C004C9 for ; Tue, 7 May 2019 20:47:38 +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 4230620449 for ; Tue, 7 May 2019 20:47:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=intel-com.20150623.gappssmtp.com header.i=@intel-com.20150623.gappssmtp.com header.b="rqW6lucK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4230620449 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com 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 44zBWD0VKNzDqPF for ; Wed, 8 May 2019 06:47:36 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=intel.com (client-ip=2607:f8b0:4864:20::343; helo=mail-ot1-x343.google.com; envelope-from=dan.j.williams@intel.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel-com.20150623.gappssmtp.com header.i=@intel-com.20150623.gappssmtp.com header.b="rqW6lucK"; dkim-atps=neutral Received: from mail-ot1-x343.google.com (mail-ot1-x343.google.com [IPv6:2607:f8b0:4864:20::343]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 44zBTq3xPyzDq8M for ; Wed, 8 May 2019 06:46:22 +1000 (AEST) Received: by mail-ot1-x343.google.com with SMTP id o39so16289801ota.6 for ; Tue, 07 May 2019 13:46:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Fw0JPQ4oQ07pMZfSEOmqFo0Ax/JNe6lqDNiuIeW+cfk=; b=rqW6lucK5GLSkk6D3VC83NNNr3p5l4cDVk4n80Uvm322BBV2qCuKSPr4z+P2ezcoyK z+YMgkO0V+5hEmcMr0MwF6O3QHG8xWVY2eTA1Py3k6awm18aqMlPP98eZujqBEdbRRXN aS93k1uMcPJFXIHF98HnDfB8WCQgSAWAn+PzoKcCdVTC+uJmNJ+7TTcrUEmBZNFgGikS JoN377FDE4nzpHgH/fCwVvnpugUJXF2ApAVZaCrgrLXf7ZjFcE/OLNwmWNUpvbW/wIQU Uwg4mKk8U4/mWeh5D1XY1VYZpFjHtv4IPmwLoWQVjBRPrwTp5axa3EA9O5FG/AT874cG VNvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Fw0JPQ4oQ07pMZfSEOmqFo0Ax/JNe6lqDNiuIeW+cfk=; b=ltgfflJaoFbezRLOZ4t1d743D3ifgL3klkhmvvAn7qUcq9AoTVzhSQMz4/0sZ4Zfvz AmnDVoyrNeAAUudRTslI4bmn5LzfVZLFLrY1c/fG8Mnix4Gxwt+8A7VMU7NIXRqbuWYW 3IPe9kiVYTHvNSeOHHfI1YPWUT6wfhk6ePbfApVdr3tqHo3dhnOaoL9+7vB4pHGUgFR9 QPkcm3Af9I4QV4X6Tw96xNYmHw0+EU3q2COpLvI1iJZ0LKJnhIZMJCcEDPw8/8n81WrI YHGKU562Vbca+yr0muBl7cmNZbN0Odzzu7ddRrW7i5pwF9ktGblDmuWcpH9hmTmvcrhu Pe8A== X-Gm-Message-State: APjAAAXHEcqn7YUxTitsCRJ7RXXeBptLX4AzyLa7U5j4VOxa6a0nfWin yY7bncRYGjR/8R9dLMDbXYkyj+u1qzpuuUkMaMFD7A== X-Google-Smtp-Source: APXvYqwkL7vHIYJxD+HfiXZUkr4PGh3XR7bd+koUKuRLubXL7y6kGEyKk74Z2RGz0ad/moc44qYziRyn+VmkpRZHHO8= X-Received: by 2002:a9d:6f19:: with SMTP id n25mr2402081otq.367.1557261979262; Tue, 07 May 2019 13:46:19 -0700 (PDT) MIME-Version: 1.0 References: <20190507183804.5512-1-david@redhat.com> <20190507183804.5512-3-david@redhat.com> In-Reply-To: <20190507183804.5512-3-david@redhat.com> From: Dan Williams Date: Tue, 7 May 2019 13:46:08 -0700 Message-ID: Subject: Re: [PATCH v2 2/8] s390x/mm: Implement arch_remove_memory() To: David Hildenbrand Content-Type: text/plain; charset="UTF-8" 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 , Michal Hocko , linux-ia64@vger.kernel.org, Vasily Gorbik , Linux-sh , Heiko Carstens , Linux Kernel Mailing List , Linux MM , Mike Rapoport , Martin Schwidefsky , Andrew Morton , linuxppc-dev Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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.