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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 0EB4CC43461 for ; Fri, 16 Apr 2021 19:46:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DFB5A6137D for ; Fri, 16 Apr 2021 19:46:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236414AbhDPTrM (ORCPT ); Fri, 16 Apr 2021 15:47:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:37576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236085AbhDPTrL (ORCPT ); Fri, 16 Apr 2021 15:47:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 86D30613CB; Fri, 16 Apr 2021 19:46:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1618602406; bh=rvNLvVMySnSPqdVuiuLrEL+Xf2aX2+ZV9QGq0xfgqT0=; h=Date:From:To:Subject:From; b=2aVSGR8pR0W3YSdgHQrjNqk4Z2CH/DARYSWWhZhTQ4mA+zi5WgWT2AJcsjHvilI8+ YmGd+MdfJu1GWvV9gSW59PobyCZwSM7QpyaUjqXx2xOqRUzIrrY+cgn0MOS2gQStxs kZ/xCmXMTZF93DNO3MhqCucrUob4TO78M+HnfXic= Date: Fri, 16 Apr 2021 12:46:46 -0700 From: akpm@linux-foundation.org To: mm-commits@vger.kernel.org, vbabka@suse.cz, pasha.tatashin@soleen.com, osalvador@suse.de, mhocko@suse.com, mhocko@kernel.org, anshuman.khandual@arm.com, david@redhat.com Subject: [to-be-updated] =?us-ascii?Q?mmmemory=5Fhotplug-factor-out-adjusting-present-pages-into?= =?us-ascii?Q?-adjust=5Fpresent=5Fpage=5Fcount.patch?= removed from -mm tree Message-ID: <20210416194646.67wXZ%akpm@linux-foundation.org> User-Agent: s-nail v14.9.10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The patch titled Subject: mm,memory_hotplug: factor out adjusting present pages into adjust_present_page_count() has been removed from the -mm tree. Its filename was mmmemory_hotplug-factor-out-adjusting-present-pages-into-adjust_present_page_count.patch This patch was dropped because an updated version will be merged ------------------------------------------------------ From: David Hildenbrand Subject: mm,memory_hotplug: factor out adjusting present pages into adjust_present_page_count() Let's have a single place (inspired by adjust_managed_page_count()) where we adjust present pages. In contrast to adjust_managed_page_count(), only memory onlining/offlining is allowed to modify the number of present pages. Link: https://lkml.kernel.org/r/20210416112411.9826-4-osalvador@suse.de Signed-off-by: David Hildenbrand Signed-off-by: Oscar Salvador Reviewed-by: Oscar Salvador Cc: Anshuman Khandual Cc: Michal Hocko Cc: Michal Hocko Cc: Pavel Tatashin Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/memory_hotplug.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) --- a/mm/memory_hotplug.c~mmmemory_hotplug-factor-out-adjusting-present-pages-into-adjust_present_page_count +++ a/mm/memory_hotplug.c @@ -829,6 +829,16 @@ struct zone * zone_for_pfn_range(int onl return default_zone_for_pfn(nid, start_pfn, nr_pages); } +static void adjust_present_page_count(struct zone *zone, long nr_pages) +{ + unsigned long flags; + + zone->present_pages += nr_pages; + pgdat_resize_lock(zone->zone_pgdat, &flags); + zone->zone_pgdat->node_present_pages += nr_pages; + pgdat_resize_unlock(zone->zone_pgdat, &flags); +} + int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_type, int nid) { @@ -882,11 +892,7 @@ int __ref online_pages(unsigned long pfn } online_pages_range(pfn, nr_pages); - zone->present_pages += nr_pages; - - pgdat_resize_lock(zone->zone_pgdat, &flags); - zone->zone_pgdat->node_present_pages += nr_pages; - pgdat_resize_unlock(zone->zone_pgdat, &flags); + adjust_present_page_count(zone, nr_pages); node_states_set_node(nid, &arg); if (need_zonelists_rebuild) @@ -1702,11 +1708,7 @@ int __ref offline_pages(unsigned long st /* removal success */ adjust_managed_page_count(pfn_to_page(start_pfn), -nr_pages); - zone->present_pages -= nr_pages; - - pgdat_resize_lock(zone->zone_pgdat, &flags); - zone->zone_pgdat->node_present_pages -= nr_pages; - pgdat_resize_unlock(zone->zone_pgdat, &flags); + adjust_present_page_count(zone, -nr_pages); init_per_zone_wmark_min(); _ Patches currently in -mm which might be from david@redhat.com are mm-page_alloc-drop-pr_info_ratelimited-in-alloc_contig_range.patch kernel-resource-make-walk_system_ram_res-find-all-busy-ioresource_system_ram-resources.patch kernel-resource-make-walk_mem_res-find-all-busy-ioresource_mem-resources.patch kernel-resource-remove-first_lvl-siblings_only-logic.patch drivers-char-remove-dev-kmem-for-good.patch mm-remove-xlate_dev_kmem_ptr.patch mm-vmalloc-remove-vwrite.patch