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=-1.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_DBL_ABUSE_MALW autolearn=no 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 97D72C2D0DB for ; Tue, 28 Jan 2020 13:50:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4E13324683 for ; Tue, 28 Jan 2020 13:50:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="zahaDa+T" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E13324683 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B43EB6B026F; Tue, 28 Jan 2020 08:50:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AD1846B0270; Tue, 28 Jan 2020 08:50:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F5D16B0271; Tue, 28 Jan 2020 08:50:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0147.hostedemail.com [216.40.44.147]) by kanga.kvack.org (Postfix) with ESMTP id 71B8C6B026F for ; Tue, 28 Jan 2020 08:50:02 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 110718248D51 for ; Tue, 28 Jan 2020 13:50:02 +0000 (UTC) X-FDA: 76427176644.24.work47_3a6b07c48ee15 X-HE-Tag: work47_3a6b07c48ee15 X-Filterd-Recvd-Size: 9552 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Tue, 28 Jan 2020 13:50:01 +0000 (UTC) Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 17E8924693; Tue, 28 Jan 2020 13:50:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580219400; bh=votGUuM6i4cnRsdtXLiFy7wNgPTcgA7gUAYLg8kH71Q=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=zahaDa+TPj7rSG9B1cX/wao1KZKUOB+ppE69gfuq/RAEUgu/F/T5McJLTk17AkJFS io9qacW2sVS6ZAMSJCSEMkWZOAYysUt+otDvUf3KL5S+knX9w87nhqpWEe1TlGsK5n djzVweDZIOaP7tOHD/rEk6XeSbH8H8AoM3jTIOBU= Subject: Patch "mm/memory_hotplug: make __remove_section() never fail" has been added to the 4.19-stable tree To: 20190409100148.24703-4-david@redhat.com,akpm@linux-foundation.org,andrew.banman@hpe.com,aneesh.kumar@linux.ibm.com,arunks@codeaurora.org,benh@kernel.crashing.org,bhe@redhat.com,bp@alien8.de,cai@lca.pw,christophe.leroy@c-s.fr,dalias@libc.org,dan.j.williams@intel.com,dave.hansen@linux.intel.com,david@redhat.com,fenghua.yu@intel.com,geert@linux-m68k.org,gor@linux.ibm.com,gregkh@linuxfoundation.org,heiko.carstens@de.ibm.com,hpa@zytor.com,iamjoonsoo.kim@lge.com,kirill.shutemov@linux.intel.com,linux-mm@kvack.org,luto@kernel.org,malat@debian.org,mhocko@suse.com,mike.travis@hpe.com,mingo@kernel.org,mingo@redhat.com,mpe@ellerman.id.au,npiggin@gmail.com,osalvador@suse.com,osalvador@suse.de,pasha.tatashin@soleen.com,paulus@samba.org,peterz@infradead.org,rafael@kernel.org,richard.weiyang@gmail.com,robh@kernel.org,rppt@linux.ibm.com,schwidefsky@de.ibm.com,stefan@agner.ch,tglx@linutronix.de,tony.luck@intel.com,torvalds@linux-foundation.org,yamada.masahiro@socionext.com,ysato@users.sour ceforge. jp Cc: From: Date: Tue, 28 Jan 2020 14:49:41 +0100 In-Reply-To: <20200128095021.8076-11-david@redhat.com> Message-ID: <158021938122174@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 X-stable: commit X-Patchwork-Hint: ignore Content-Transfer-Encoding: quoted-printable 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: This is a note to let you know that I've just added the patch titled mm/memory_hotplug: make __remove_section() never fail to the 4.19-stable tree which can be found at: http://www.kernel.org/git/?p=3Dlinux/kernel/git/stable/stable-queue.g= it;a=3Dsummary The filename of the patch is: mm-memory_hotplug-make-__remove_section-never-fail.patch and it can be found in the queue-4.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From foo@baz Tue 28 Jan 2020 02:32:10 PM CET From: David Hildenbrand Date: Tue, 28 Jan 2020 10:50:07 +0100 Subject: mm/memory_hotplug: make __remove_section() never fail To: stable@vger.kernel.org Cc: linux-mm@kvack.org, Michal Hocko , Greg Kroah-Hartma= n , Andrew Morton = , "Aneesh Kumar K . V" , Baoquan He , Dan Williams , Oscar Salvador , Wei Yang , David Hildenbrand Message-ID: <20200128095021.8076-11-david@redhat.com> From: David Hildenbrand commit 9d1d887d785b4fe0590bd3c5e71acaa3908044e2 upstream. Let's just warn in case a section is not valid instead of failing to remove somewhere in the middle of the process, returning an error that will be mostly ignored by callers. Link: http://lkml.kernel.org/r/20190409100148.24703-4-david@redhat.com Signed-off-by: David Hildenbrand Reviewed-by: Oscar Salvador Cc: Michal Hocko Cc: David Hildenbrand Cc: Pavel Tatashin Cc: Qian Cai Cc: Wei Yang Cc: Arun KS Cc: Mathieu Malaterre Cc: Andrew Banman Cc: Andy Lutomirski Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Christophe Leroy Cc: Dave Hansen Cc: Fenghua Yu Cc: Geert Uytterhoeven Cc: Greg Kroah-Hartman Cc: Heiko Carstens Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Ingo Molnar Cc: Joonsoo Kim Cc: "Kirill A. Shutemov" Cc: Martin Schwidefsky Cc: Masahiro Yamada Cc: Michael Ellerman Cc: Mike Rapoport Cc: Mike Travis Cc: Nicholas Piggin Cc: Oscar Salvador Cc: Paul Mackerras Cc: Peter Zijlstra Cc: "Rafael J. Wysocki" Cc: Rich Felker Cc: Rob Herring Cc: Stefan Agner Cc: Thomas Gleixner Cc: Tony Luck Cc: Vasily Gorbik Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: David Hildenbrand Signed-off-by: Greg Kroah-Hartman --- mm/memory_hotplug.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -478,15 +478,15 @@ static void __remove_zone(struct zone *z pgdat_resize_unlock(zone->zone_pgdat, &flags); } =20 -static int __remove_section(struct zone *zone, struct mem_section *ms, - unsigned long map_offset, struct vmem_altmap *altmap) +static void __remove_section(struct zone *zone, struct mem_section *ms, + unsigned long map_offset, + struct vmem_altmap *altmap) { unsigned long start_pfn; int scn_nr; - int ret =3D -EINVAL; =20 - if (!valid_section(ms)) - return ret; + if (WARN_ON_ONCE(!valid_section(ms))) + return; =20 unregister_memory_section(ms); =20 @@ -495,7 +495,6 @@ static int __remove_section(struct zone __remove_zone(zone, start_pfn); =20 sparse_remove_one_section(zone, ms, map_offset, altmap); - return 0; } =20 /** @@ -515,7 +514,7 @@ int __remove_pages(struct zone *zone, un { unsigned long i; unsigned long map_offset =3D 0; - int sections_to_remove, ret =3D 0; + int sections_to_remove; =20 /* In the ZONE_DEVICE case device driver owns the memory region */ if (is_dev_zone(zone)) { @@ -536,16 +535,13 @@ int __remove_pages(struct zone *zone, un unsigned long pfn =3D phys_start_pfn + i*PAGES_PER_SECTION; =20 cond_resched(); - ret =3D __remove_section(zone, __pfn_to_section(pfn), map_offset, - altmap); + __remove_section(zone, __pfn_to_section(pfn), map_offset, + altmap); map_offset =3D 0; - if (ret) - break; } =20 set_zone_contiguous(zone); - - return ret; + return 0; } #endif /* CONFIG_MEMORY_HOTREMOVE */ =20 Patches currently in stable-queue which might be from david@redhat.com ar= e queue-4.19/mm-memory_hotplug-remove-memory-block-devices-before-arch_remo= ve_memory.patch queue-4.19/mm-hotplug-kill-is_dev_zone-usage-in-__remove_pages.patch queue-4.19/mm-memory_hotplug-create-memory-block-devices-after-arch_add_m= emory.patch queue-4.19/drivers-base-memory-pass-a-block_id-to-init_memory_block.patch queue-4.19/drivers-base-memory.c-clean-up-relics-in-function-parameters.p= atch queue-4.19/mm-memory_hotplug-update-a-comment-in-unregister_memory.patch queue-4.19/mm-memory_hotplug-shrink-zones-when-offlining-memory.patch queue-4.19/mm-memory_hotplug-make-unregister_memory_block_under_nodes-nev= er-fail.patch queue-4.19/mm-memunmap-don-t-access-uninitialized-memmap-in-memunmap_page= s.patch queue-4.19/mm-memory_hotplug-make-__remove_section-never-fail.patch queue-4.19/mm-sparse-drop-pgdat_resize_lock-in-sparse_add-remove_one_sect= ion.patch queue-4.19/mm-memory_hotplug-make-unregister_memory_section-never-fail.pa= tch queue-4.19/mm-memory_hotplug-release-memory-resource-after-arch_remove_me= mory.patch queue-4.19/mm-memory_hotplug-add-nid-parameter-to-arch_remove_memory.patc= h queue-4.19/powerpc-mm-fix-section-mismatch-warning.patch queue-4.19/mm-memory_hotplug-allow-arch_remove_memory-without-config_memo= ry_hotremove.patch queue-4.19/mm-memory_hotplug-make-remove_memory-take-the-device_hotplug_l= ock.patch queue-4.19/mm-memory_hotplug-make-__remove_pages-and-arch_remove_memory-n= ever-fail.patch queue-4.19/mm-memory_hotplug-fix-try_offline_node.patch queue-4.19/mm-memory_hotplug-remove-zone-parameter-from-sparse_remove_one= _section.patch queue-4.19/drivers-base-memory.c-remove-an-unnecessary-check-on-nr_mem_se= ctions.patch queue-4.19/drivers-base-node.c-simplify-unregister_memory_block_under_nod= es.patch queue-4.19/s390x-mm-implement-arch_remove_memory.patch queue-4.19/mm-sparse-pass-nid-instead-of-pgdat-to-sparse_add_one_section.= patch