diff mbox series

[2/4] mm/mm_init.c: move build check on MAX_ZONELISTS out of ifdef

Message ID 20240619010612.20740-2-richard.weiyang@gmail.com (mailing list archive)
State New
Headers show
Series [1/4] mm/sparse: nr_pages won't be 0 | expand

Commit Message

Wei Yang June 19, 2024, 1:06 a.m. UTC
Current check on MAX_ZONELISTS is wrapped in CONFIG_DEBUG_MEMORY_INIT,
which may not be triggered all the time.

Let's move it out to a more general place.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: Mike Rapoport (IBM) <rppt@kernel.org>
---
 mm/mm_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mike Rapoport June 23, 2024, 7:48 a.m. UTC | #1
On Wed, Jun 19, 2024 at 01:06:10AM +0000, Wei Yang wrote:
> Current check on MAX_ZONELISTS is wrapped in CONFIG_DEBUG_MEMORY_INIT,
> which may not be triggered all the time.
> 
> Let's move it out to a more general place.
> 
> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
> CC: Mike Rapoport (IBM) <rppt@kernel.org>

Reviewed-by: Mike Rapoport (IBM) <rppt@kernel.org>

> ---
>  mm/mm_init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/mm_init.c b/mm/mm_init.c
> index 31ebb3cd53ac..4991cb5c5436 100644
> --- a/mm/mm_init.c
> +++ b/mm/mm_init.c
> @@ -53,7 +53,6 @@ void __init mminit_verify_zonelist(void)
>  		struct zonelist *zonelist;
>  		int i, listid, zoneid;
>  
> -		BUILD_BUG_ON(MAX_ZONELISTS > 2);
>  		for (i = 0; i < MAX_ZONELISTS * MAX_NR_ZONES; i++) {
>  
>  			/* Identify the zone and nodelist */
> @@ -2668,6 +2667,7 @@ static void __init mem_init_print_info(void)
>  void __init mm_core_init(void)
>  {
>  	/* Initializations relying on SMP setup */
> +	BUILD_BUG_ON(MAX_ZONELISTS > 2);
>  	build_all_zonelists(NULL);
>  	page_alloc_init_cpuhp();
>  
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/mm/mm_init.c b/mm/mm_init.c
index 31ebb3cd53ac..4991cb5c5436 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -53,7 +53,6 @@  void __init mminit_verify_zonelist(void)
 		struct zonelist *zonelist;
 		int i, listid, zoneid;
 
-		BUILD_BUG_ON(MAX_ZONELISTS > 2);
 		for (i = 0; i < MAX_ZONELISTS * MAX_NR_ZONES; i++) {
 
 			/* Identify the zone and nodelist */
@@ -2668,6 +2667,7 @@  static void __init mem_init_print_info(void)
 void __init mm_core_init(void)
 {
 	/* Initializations relying on SMP setup */
+	BUILD_BUG_ON(MAX_ZONELISTS > 2);
 	build_all_zonelists(NULL);
 	page_alloc_init_cpuhp();