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=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS 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 1FA59C33CB2 for ; Tue, 28 Jan 2020 13:49:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CA5CD2468D for ; Tue, 28 Jan 2020 13:49:42 +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="UUhtvn8D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA5CD2468D 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 7E5666B0007; Tue, 28 Jan 2020 08:49:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 770676B0008; Tue, 28 Jan 2020 08:49:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 637C16B000A; Tue, 28 Jan 2020 08:49:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0124.hostedemail.com [216.40.44.124]) by kanga.kvack.org (Postfix) with ESMTP id 4A0286B0007 for ; Tue, 28 Jan 2020 08:49:42 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id DD5898248D51 for ; Tue, 28 Jan 2020 13:49:41 +0000 (UTC) X-FDA: 76427175762.04.bulb79_378152c3cd631 X-HE-Tag: bulb79_378152c3cd631 X-Filterd-Recvd-Size: 6646 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Tue, 28 Jan 2020 13:49:41 +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 16DFD24688; Tue, 28 Jan 2020 13:49:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580219380; bh=uHKj0Be6o/sNgGuDV1SHeEXNPtUqBKAcKaI1RTUQ7XE=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=UUhtvn8DYyJCEF7+68K21vmoOtKvHigkyjHEdsbwrvyrrUBCM0yvtfDT/9iT+zJXl ZEr4EBFtvYkHBe9dsYSX50fq6sveOBuIIKk+PAKtz0j2jVEfGgDAHg7EwoDkf+V3zB j5x8zliK1d5UsWn9LHeCucJZOTnXTH8PyJWx2SjM= Subject: Patch "drivers/base/memory.c: remove an unnecessary check on NR_MEM_SECTIONS" has been added to the 4.19-stable tree To: 20181123222811.18216-1-richard.weiyang@gmail.com,akpm@linux-foundation.org,aneesh.kumar@linux.ibm.com,bhe@redhat.com,dan.j.williams@intel.com,david@redhat.com,gregkh@linuxfoundation.org,linux-mm@kvack.org,mhocko@suse.com,osalvador@suse.de,rafael@kernel.org,richard.weiyang@gmail.com,sjenning@redhat.com,torvalds@linux-foundation.org Cc: From: Date: Tue, 28 Jan 2020 14:49:36 +0100 In-Reply-To: <20200128095021.8076-5-david@redhat.com> Message-ID: <1580219376208227@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 drivers/base/memory.c: remove an unnecessary check on NR_MEM_SECTIONS 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: drivers-base-memory.c-remove-an-unnecessary-check-on-nr_mem_sections= .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:01 +0100 Subject: drivers/base/memory.c: remove an unnecessary check on NR_MEM_SEC= TIONS 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-5-david@redhat.com> From: Wei Yang commit 3b6fd6ffb27c2efa003c6d4d15ca72c054b71d7c upstream. In cb5e39b8038b ("drivers: base: refactor add_memory_section() to add_memory_block()"), add_memory_block() is introduced, which is only invoked in memory_dev_init(). When combining these two loops in memory_dev_init() and add_memory_block(), they looks like this: for (i =3D 0; i < NR_MEM_SECTIONS; i +=3D sections_per_block) for (j =3D i; (j < i + sections_per_block) && j < NR_MEM_SECTIONS; j++) Since it is sure the (i < NR_MEM_SECTIONS) and j sits in its own memory block, the check of (j < NR_MEM_SECTIONS) is not necessary. This patch just removes this check. Link: http://lkml.kernel.org/r/20181123222811.18216-1-richard.weiyang@gma= il.com Signed-off-by: Wei Yang Reviewed-by: Andrew Morton Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Seth Jennings Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: David Hildenbrand Signed-off-by: Greg Kroah-Hartman --- drivers/base/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -691,7 +691,7 @@ static int add_memory_block(int base_sec int i, ret, section_count =3D 0, section_nr; =20 for (i =3D base_section_nr; - (i < base_section_nr + sections_per_block) && i < NR_MEM_SECTIONS; + i < base_section_nr + sections_per_block; i++) { if (!present_section_nr(i)) continue; 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