linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATVH v1 RESEND] mm: remove unused free_bootmem_with_active_regions
@ 2020-04-02 14:34 Baoquan He
  2020-04-02 15:09 ` Michal Hocko
  2020-04-02 16:03 ` David Hildenbrand
  0 siblings, 2 replies; 3+ messages in thread
From: Baoquan He @ 2020-04-02 14:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-mm, akpm, bhe

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 <bhe@redhat.com>
---
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.
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATVH v1 RESEND] mm: remove unused free_bootmem_with_active_regions
  2020-04-02 14:34 [PATVH v1 RESEND] mm: remove unused free_bootmem_with_active_regions Baoquan He
@ 2020-04-02 15:09 ` Michal Hocko
  2020-04-02 16:03 ` David Hildenbrand
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Hocko @ 2020-04-02 15:09 UTC (permalink / raw)
  To: Baoquan He; +Cc: linux-kernel, linux-mm, akpm

On Thu 02-04-20 22:34:55, Baoquan He wrote:
> 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 <bhe@redhat.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
> 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.
> -- 
> 2.17.2
> 

-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATVH v1 RESEND] mm: remove unused free_bootmem_with_active_regions
  2020-04-02 14:34 [PATVH v1 RESEND] mm: remove unused free_bootmem_with_active_regions Baoquan He
  2020-04-02 15:09 ` Michal Hocko
@ 2020-04-02 16:03 ` David Hildenbrand
  1 sibling, 0 replies; 3+ messages in thread
From: David Hildenbrand @ 2020-04-02 16:03 UTC (permalink / raw)
  To: Baoquan He, linux-kernel; +Cc: linux-mm, akpm

On 02.04.20 16:34, Baoquan He wrote:
> 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 <bhe@redhat.com>
> ---
> 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.
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-02 16:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-02 14:34 [PATVH v1 RESEND] mm: remove unused free_bootmem_with_active_regions Baoquan He
2020-04-02 15:09 ` Michal Hocko
2020-04-02 16:03 ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).