From patchwork Thu Apr 2 14:34:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 11470899 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B9F1B92C for ; Thu, 2 Apr 2020 14:35:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 864B42073B for ; Thu, 2 Apr 2020 14:35:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fy3zDbAx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 864B42073B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AF2488E0008; Thu, 2 Apr 2020 10:35:03 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id AA3618E0007; Thu, 2 Apr 2020 10:35:03 -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 9B9308E0008; Thu, 2 Apr 2020 10:35:03 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0220.hostedemail.com [216.40.44.220]) by kanga.kvack.org (Postfix) with ESMTP id 866FF8E0007 for ; Thu, 2 Apr 2020 10:35:03 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 3D4AF181AEF0B for ; Thu, 2 Apr 2020 14:35:03 +0000 (UTC) X-FDA: 76663162086.19.dime45_efde18772b06 X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,bhe@redhat.com,,RULES_HIT:30051:30054:30090,0,RBL:205.139.110.61:@redhat.com:.lbl8.mailshell.net-62.18.0.100 66.10.201.10,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: dime45_efde18772b06 X-Filterd-Recvd-Size: 4551 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Apr 2020 14:35:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585838102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=U5TW3tLNBoW1wE1/0X4wPl+Z8kZSp5XcsvgUrccM52w=; b=fy3zDbAxjEQ6HG+5JsOeo5n02Y+UgQkV9+TrZUCTsHpNLFUZt3WHKhd5dSGYsMApePBfhI mPDDCpl8nn6kFG9nYJRkiF/uA8dMgxjm/oiS5j6GN+Und1vydYKbshMHk6dcgGEKhBsTbW cuPNQSiC/1V91N/NVnxSfV0qnnk6Oho= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-44-Yse6U43KOUuc0iAIiMyAhA-1; Thu, 02 Apr 2020 10:34:59 -0400 X-MC-Unique: Yse6U43KOUuc0iAIiMyAhA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B3008801E5C; Thu, 2 Apr 2020 14:34:58 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-36.pek2.redhat.com [10.72.12.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0FEAB5C1B0; Thu, 2 Apr 2020 14:34:56 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, bhe@redhat.com Subject: [PATVH v1 RESEND] mm: remove unused free_bootmem_with_active_regions Date: Thu, 2 Apr 2020 22:34:55 +0800 Message-Id: <20200402143455.5145-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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: Since commit 397dc00e249ec64e10 ("mips: sgi-ip27: switch from DISCONTIGMEM to SPARSEMEM"), the last caller of free_bootmem_with_active_regions() was gone. Now no user calls it any more. Let's remove it. Signed-off-by: Baoquan He Acked-by: Michal Hocko Reviewed-by: David Hildenbrand --- RESEND: To add linux-mm to CC list. include/linux/mm.h | 4 ---- mm/page_alloc.c | 25 ------------------------- 2 files changed, 29 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 1cd8b8f8534d..9c093f7c751d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2363,8 +2363,6 @@ static inline unsigned long get_num_physpages(void) * memblock_add_node(base, size, nid) * free_area_init_nodes(max_zone_pfns); * - * free_bootmem_with_active_regions() calls free_bootmem_node() for each - * registered physical page range. Similarly * sparse_memory_present_with_active_regions() calls memory_present() for * each range when SPARSEMEM is enabled. * @@ -2380,8 +2378,6 @@ extern unsigned long absent_pages_in_range(unsigned long start_pfn, extern void get_pfn_range_for_nid(unsigned int nid, unsigned long *start_pfn, unsigned long *end_pfn); extern unsigned long find_min_pfn_with_active_regions(void); -extern void free_bootmem_with_active_regions(int nid, - unsigned long max_low_pfn); extern void sparse_memory_present_with_active_regions(int nid); #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 138a56c0f48f..2892ebeaa6c9 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6356,31 +6356,6 @@ int __meminit __early_pfn_to_nid(unsigned long pfn, } #endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */ -/** - * free_bootmem_with_active_regions - Call memblock_free_early_nid for each active range - * @nid: The node to free memory on. If MAX_NUMNODES, all nodes are freed. - * @max_low_pfn: The highest PFN that will be passed to memblock_free_early_nid - * - * If an architecture guarantees that all ranges registered contain no holes - * and may be freed, this this function may be used instead of calling - * memblock_free_early_nid() manually. - */ -void __init free_bootmem_with_active_regions(int nid, unsigned long max_low_pfn) -{ - unsigned long start_pfn, end_pfn; - int i, this_nid; - - for_each_mem_pfn_range(i, nid, &start_pfn, &end_pfn, &this_nid) { - start_pfn = min(start_pfn, max_low_pfn); - end_pfn = min(end_pfn, max_low_pfn); - - if (start_pfn < end_pfn) - memblock_free_early_nid(PFN_PHYS(start_pfn), - (end_pfn - start_pfn) << PAGE_SHIFT, - this_nid); - } -} - /** * sparse_memory_present_with_active_regions - Call memory_present for each active range * @nid: The node to call memory_present for. If MAX_NUMNODES, all nodes will be used.