From patchwork Tue May 7 18:37:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10933563 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 91D37112C for ; Tue, 7 May 2019 18:38:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 826772880D for ; Tue, 7 May 2019 18:38:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76DCB2891A; Tue, 7 May 2019 18:38:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2223E2880D for ; Tue, 7 May 2019 18:38:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9DE5C6B0007; Tue, 7 May 2019 14:38:30 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9907B6B0008; Tue, 7 May 2019 14:38:30 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 859D86B000A; Tue, 7 May 2019 14:38:30 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by kanga.kvack.org (Postfix) with ESMTP id 643036B0007 for ; Tue, 7 May 2019 14:38:30 -0400 (EDT) Received: by mail-qk1-f199.google.com with SMTP id u15so18996801qkj.12 for ; Tue, 07 May 2019 11:38:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=S+eOGatgZeskj0KU0uy0qphspDfnUZrs/C9R13O+fz8=; b=MxfNKBFWG5P6vg6ILAgTLGRVEVvGL3k7bMHxfEVUlNjrl+pd01eepSRDjqmk3VHKuu HcdXMU8uSnBtfJyzNhDIDEoMAVXEr2F2LeiFbO9R2b/l+FYjHDqdBTfJ6AXuQ6maOe7F hlVWWRswAZYkwiyTnd7sX9dzcpVhPkNb9dgLlhjl2CV9j2hVZJfUe+QHkTcD7iNYW/eq P4EICM46Y8B77s3FV55aQDPnsxwF3iVBSlT/oyJ5knS4PvB5XJRUJk10RgOrv+O1+cre hXQ6hTTewmcjs2lVlExUpsY3sod7MdUHgD+XVuIV3awoSuWF6lUdktzSQ8nMJZ9/uBEm +goQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: APjAAAVhkewPbQf9mrxrrrpN5pMydKm87My3F8+sybkHgI6TpFu8DwjY 5c8MBpMWvhzrdJwaRv2WEbtwUZQ3/ydcUg+RHwSndamrlKV+w+FMLLlP8zu1Vu2uV5nhYDx24rN O1Ee0kw4AljKjD0Mxf9T0ZMEIiHUj4djx5D5EYqD5Q+TaMQzqMxvNAFJ+9KcxZXFVMw== X-Received: by 2002:a0c:969d:: with SMTP id a29mr27368157qvd.56.1557254310188; Tue, 07 May 2019 11:38:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXDiwvoDslaowcUAc/MgTBtuaF6GiP8dz1ZcxtSl0jtlrUAG+rPoeM0HfYI/YLP3qUpVEn X-Received: by 2002:a0c:969d:: with SMTP id a29mr27368121qvd.56.1557254309640; Tue, 07 May 2019 11:38:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557254309; cv=none; d=google.com; s=arc-20160816; b=EFBisREWI8fm8K7ZXX+VOx6ZGf71R0Aq/GL/wEkYU4dRB4fT61kKcFovgycKwvjtv0 eXVJ9cb5miF8iAtyFlIRcTyySm6JQzo6qdk2805EkPSYNZiBBFFtlVDe06tSA4YozPjp 7goh2UFUf8sy5ukDhP7OWDjex5PEnkVXmORKuAzVQgpjoysn07WZ5Q3EDgt2JaG5W2r0 dpW3l9G7TcEP829H7E+CS3VFk3/MH98SsMwsa2JYGmirdlA4y4OZNO2cQOYUTS9BHB+G FB8e+lHPefhbFOOOnZQADkIPX4TbLjsm/2oVbNXmX9yKGTDrLgl3Puz3QSFDUsnA/l4V stYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=S+eOGatgZeskj0KU0uy0qphspDfnUZrs/C9R13O+fz8=; b=tguUGNsoZ4SHpTi0agOzOz87VcIko0CHtTMSI0VPlE97D7I6pSKICILSsh+jyNC3im io2EEV3TglIDH1fZpGMIWiMQotW/BS/VZrsMzYwWF1y0YJksAlyOoZzGk2Pppdllp2Hx ieZKS+iXgOzL98gCzaU1+2VDGyG+Snd/1mFnWfGzMaKa9Izh4nk1oo0H/xpIgdFxrR2l ATFFhPC2ZY4gX6qohoSpuJBDaqjyJ0tsSzl6vcOyapoUmhsGTPyix6dGnvW5zyX3UGCx G0rsVCpG4cPrC4qCbRFXbeDNvQDrNvEm6BQQkrBmpIsr37F/TKqKveMlbL8T0rERVHCt 0dng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id l12si7632452qtj.182.2019.05.07.11.38.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 11:38:29 -0700 (PDT) Received-SPF: pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ABD9B308FEE2; Tue, 7 May 2019 18:38:28 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-95.ams2.redhat.com [10.36.116.95]) by smtp.corp.redhat.com (Postfix) with ESMTP id B1B871EF; Tue, 7 May 2019 18:38:23 +0000 (UTC) From: David Hildenbrand 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 , David Hildenbrand , Martin Schwidefsky , Heiko Carstens , Michal Hocko , Mike Rapoport , Vasily Gorbik , Oscar Salvador Subject: [PATCH v2 2/8] s390x/mm: Implement arch_remove_memory() Date: Tue, 7 May 2019 20:37:58 +0200 Message-Id: <20190507183804.5512-3-david@redhat.com> In-Reply-To: <20190507183804.5512-1-david@redhat.com> References: <20190507183804.5512-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 07 May 2019 18:38:28 +0000 (UTC) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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)); + __remove_pages(zone, start_pfn, nr_pages, altmap); + vmem_remove_mapping(start, size); } #endif #endif /* CONFIG_MEMORY_HOTPLUG */