All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: pagealloc: fix continued prints in show_free_areas
@ 2016-10-18 11:34 ` Mark Rutland
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Rutland @ 2016-10-18 11:34 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mark Rutland, Andrew Morton, Vlastimil Babka, Mel Gorman, linux-mm

Recently, printk was reworked in commit:

  4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation
  lines")

As of this commit, printk calls missing KERN_CONT will have a linebreak
inserted implicitly.

In show_free_areas, we miss KERN_CONT in a few cases, and as a result
prints are unexpectedly split over a number of lines, making them
difficult to read (in v4.9-rc1).

This patch uses pr_cont (with uits implicit KERN_CONT) to mark all
continued prints that occur withing a show_free_areas() call. Note that
show_migration_types() is only called by show_free_areas().
Depending on CONFIG_NUMA a printk after show_node() may or may not be a
continuation, but follows an explicit newline if not (and thus marking
it as a continuation should not be harmful).

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
---
 mm/page_alloc.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 2b3bf67..833f271 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4224,7 +4224,7 @@ static void show_migration_types(unsigned char type)
 	}
 
 	*p = '\0';
-	printk("(%s) ", tmp);
+	pr_cont("(%s) ", tmp);
 }
 
 /*
@@ -4335,7 +4335,7 @@ void show_free_areas(unsigned int filter)
 			free_pcp += per_cpu_ptr(zone->pageset, cpu)->pcp.count;
 
 		show_node(zone);
-		printk("%s"
+		pr_cont("%s"
 			" free:%lukB"
 			" min:%lukB"
 			" low:%lukB"
@@ -4382,8 +4382,8 @@ void show_free_areas(unsigned int filter)
 			K(zone_page_state(zone, NR_FREE_CMA_PAGES)));
 		printk("lowmem_reserve[]:");
 		for (i = 0; i < MAX_NR_ZONES; i++)
-			printk(" %ld", zone->lowmem_reserve[i]);
-		printk("\n");
+			pr_cont(" %ld", zone->lowmem_reserve[i]);
+		pr_cont("\n");
 	}
 
 	for_each_populated_zone(zone) {
@@ -4394,7 +4394,7 @@ void show_free_areas(unsigned int filter)
 		if (skip_free_areas_node(filter, zone_to_nid(zone)))
 			continue;
 		show_node(zone);
-		printk("%s: ", zone->name);
+		pr_cont("%s: ", zone->name);
 
 		spin_lock_irqsave(&zone->lock, flags);
 		for (order = 0; order < MAX_ORDER; order++) {
@@ -4412,11 +4412,11 @@ void show_free_areas(unsigned int filter)
 		}
 		spin_unlock_irqrestore(&zone->lock, flags);
 		for (order = 0; order < MAX_ORDER; order++) {
-			printk("%lu*%lukB ", nr[order], K(1UL) << order);
+			pr_cont("%lu*%lukB ", nr[order], K(1UL) << order);
 			if (nr[order])
 				show_migration_types(types[order]);
 		}
-		printk("= %lukB\n", K(total));
+		pr_cont("= %lukB\n", K(total));
 	}
 
 	hugetlb_show_meminfo();
-- 
1.9.1

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

* [PATCH] mm: pagealloc: fix continued prints in show_free_areas
@ 2016-10-18 11:34 ` Mark Rutland
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Rutland @ 2016-10-18 11:34 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mark Rutland, Andrew Morton, Vlastimil Babka, Mel Gorman, linux-mm

Recently, printk was reworked in commit:

  4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation
  lines")

As of this commit, printk calls missing KERN_CONT will have a linebreak
inserted implicitly.

In show_free_areas, we miss KERN_CONT in a few cases, and as a result
prints are unexpectedly split over a number of lines, making them
difficult to read (in v4.9-rc1).

This patch uses pr_cont (with uits implicit KERN_CONT) to mark all
continued prints that occur withing a show_free_areas() call. Note that
show_migration_types() is only called by show_free_areas().
Depending on CONFIG_NUMA a printk after show_node() may or may not be a
continuation, but follows an explicit newline if not (and thus marking
it as a continuation should not be harmful).

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
---
 mm/page_alloc.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 2b3bf67..833f271 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4224,7 +4224,7 @@ static void show_migration_types(unsigned char type)
 	}
 
 	*p = '\0';
-	printk("(%s) ", tmp);
+	pr_cont("(%s) ", tmp);
 }
 
 /*
@@ -4335,7 +4335,7 @@ void show_free_areas(unsigned int filter)
 			free_pcp += per_cpu_ptr(zone->pageset, cpu)->pcp.count;
 
 		show_node(zone);
-		printk("%s"
+		pr_cont("%s"
 			" free:%lukB"
 			" min:%lukB"
 			" low:%lukB"
@@ -4382,8 +4382,8 @@ void show_free_areas(unsigned int filter)
 			K(zone_page_state(zone, NR_FREE_CMA_PAGES)));
 		printk("lowmem_reserve[]:");
 		for (i = 0; i < MAX_NR_ZONES; i++)
-			printk(" %ld", zone->lowmem_reserve[i]);
-		printk("\n");
+			pr_cont(" %ld", zone->lowmem_reserve[i]);
+		pr_cont("\n");
 	}
 
 	for_each_populated_zone(zone) {
@@ -4394,7 +4394,7 @@ void show_free_areas(unsigned int filter)
 		if (skip_free_areas_node(filter, zone_to_nid(zone)))
 			continue;
 		show_node(zone);
-		printk("%s: ", zone->name);
+		pr_cont("%s: ", zone->name);
 
 		spin_lock_irqsave(&zone->lock, flags);
 		for (order = 0; order < MAX_ORDER; order++) {
@@ -4412,11 +4412,11 @@ void show_free_areas(unsigned int filter)
 		}
 		spin_unlock_irqrestore(&zone->lock, flags);
 		for (order = 0; order < MAX_ORDER; order++) {
-			printk("%lu*%lukB ", nr[order], K(1UL) << order);
+			pr_cont("%lu*%lukB ", nr[order], K(1UL) << order);
 			if (nr[order])
 				show_migration_types(types[order]);
 		}
-		printk("= %lukB\n", K(total));
+		pr_cont("= %lukB\n", K(total));
 	}
 
 	hugetlb_show_meminfo();
-- 
1.9.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm: pagealloc: fix continued prints in show_free_areas
  2016-10-18 11:34 ` Mark Rutland
@ 2016-10-18 13:00   ` Vlastimil Babka
  -1 siblings, 0 replies; 8+ messages in thread
From: Vlastimil Babka @ 2016-10-18 13:00 UTC (permalink / raw)
  To: Mark Rutland, linux-kernel
  Cc: Andrew Morton, Mel Gorman, linux-mm, Joe Perches, Michal Hocko

On 10/18/2016 01:34 PM, Mark Rutland wrote:
> Recently, printk was reworked in commit:
>
>   4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation
>   lines")
>
> As of this commit, printk calls missing KERN_CONT will have a linebreak
> inserted implicitly.
>
> In show_free_areas, we miss KERN_CONT in a few cases, and as a result
> prints are unexpectedly split over a number of lines, making them
> difficult to read (in v4.9-rc1).
>
> This patch uses pr_cont (with uits implicit KERN_CONT) to mark all
> continued prints that occur withing a show_free_areas() call. Note that
> show_migration_types() is only called by show_free_areas().
> Depending on CONFIG_NUMA a printk after show_node() may or may not be a
> continuation, but follows an explicit newline if not (and thus marking
> it as a continuation should not be harmful).

I think this was already fixed:

http://marc.info/?l=linux-mm&m=147623910031630&w=2

> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Vlastimil Babka <vbabka@suse.cz>
> Cc: Mel Gorman <mgorman@techsingularity.net>
> Cc: linux-mm@kvack.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  mm/page_alloc.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 2b3bf67..833f271 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -4224,7 +4224,7 @@ static void show_migration_types(unsigned char type)
>  	}
>
>  	*p = '\0';
> -	printk("(%s) ", tmp);
> +	pr_cont("(%s) ", tmp);
>  }
>
>  /*
> @@ -4335,7 +4335,7 @@ void show_free_areas(unsigned int filter)
>  			free_pcp += per_cpu_ptr(zone->pageset, cpu)->pcp.count;
>
>  		show_node(zone);
> -		printk("%s"
> +		pr_cont("%s"
>  			" free:%lukB"
>  			" min:%lukB"
>  			" low:%lukB"
> @@ -4382,8 +4382,8 @@ void show_free_areas(unsigned int filter)
>  			K(zone_page_state(zone, NR_FREE_CMA_PAGES)));
>  		printk("lowmem_reserve[]:");
>  		for (i = 0; i < MAX_NR_ZONES; i++)
> -			printk(" %ld", zone->lowmem_reserve[i]);
> -		printk("\n");
> +			pr_cont(" %ld", zone->lowmem_reserve[i]);
> +		pr_cont("\n");
>  	}
>
>  	for_each_populated_zone(zone) {
> @@ -4394,7 +4394,7 @@ void show_free_areas(unsigned int filter)
>  		if (skip_free_areas_node(filter, zone_to_nid(zone)))
>  			continue;
>  		show_node(zone);
> -		printk("%s: ", zone->name);
> +		pr_cont("%s: ", zone->name);
>
>  		spin_lock_irqsave(&zone->lock, flags);
>  		for (order = 0; order < MAX_ORDER; order++) {
> @@ -4412,11 +4412,11 @@ void show_free_areas(unsigned int filter)
>  		}
>  		spin_unlock_irqrestore(&zone->lock, flags);
>  		for (order = 0; order < MAX_ORDER; order++) {
> -			printk("%lu*%lukB ", nr[order], K(1UL) << order);
> +			pr_cont("%lu*%lukB ", nr[order], K(1UL) << order);
>  			if (nr[order])
>  				show_migration_types(types[order]);
>  		}
> -		printk("= %lukB\n", K(total));
> +		pr_cont("= %lukB\n", K(total));
>  	}
>
>  	hugetlb_show_meminfo();
>

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

* Re: [PATCH] mm: pagealloc: fix continued prints in show_free_areas
@ 2016-10-18 13:00   ` Vlastimil Babka
  0 siblings, 0 replies; 8+ messages in thread
From: Vlastimil Babka @ 2016-10-18 13:00 UTC (permalink / raw)
  To: Mark Rutland, linux-kernel
  Cc: Andrew Morton, Mel Gorman, linux-mm, Joe Perches, Michal Hocko

On 10/18/2016 01:34 PM, Mark Rutland wrote:
> Recently, printk was reworked in commit:
>
>   4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation
>   lines")
>
> As of this commit, printk calls missing KERN_CONT will have a linebreak
> inserted implicitly.
>
> In show_free_areas, we miss KERN_CONT in a few cases, and as a result
> prints are unexpectedly split over a number of lines, making them
> difficult to read (in v4.9-rc1).
>
> This patch uses pr_cont (with uits implicit KERN_CONT) to mark all
> continued prints that occur withing a show_free_areas() call. Note that
> show_migration_types() is only called by show_free_areas().
> Depending on CONFIG_NUMA a printk after show_node() may or may not be a
> continuation, but follows an explicit newline if not (and thus marking
> it as a continuation should not be harmful).

I think this was already fixed:

http://marc.info/?l=linux-mm&m=147623910031630&w=2

> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Vlastimil Babka <vbabka@suse.cz>
> Cc: Mel Gorman <mgorman@techsingularity.net>
> Cc: linux-mm@kvack.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  mm/page_alloc.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 2b3bf67..833f271 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -4224,7 +4224,7 @@ static void show_migration_types(unsigned char type)
>  	}
>
>  	*p = '\0';
> -	printk("(%s) ", tmp);
> +	pr_cont("(%s) ", tmp);
>  }
>
>  /*
> @@ -4335,7 +4335,7 @@ void show_free_areas(unsigned int filter)
>  			free_pcp += per_cpu_ptr(zone->pageset, cpu)->pcp.count;
>
>  		show_node(zone);
> -		printk("%s"
> +		pr_cont("%s"
>  			" free:%lukB"
>  			" min:%lukB"
>  			" low:%lukB"
> @@ -4382,8 +4382,8 @@ void show_free_areas(unsigned int filter)
>  			K(zone_page_state(zone, NR_FREE_CMA_PAGES)));
>  		printk("lowmem_reserve[]:");
>  		for (i = 0; i < MAX_NR_ZONES; i++)
> -			printk(" %ld", zone->lowmem_reserve[i]);
> -		printk("\n");
> +			pr_cont(" %ld", zone->lowmem_reserve[i]);
> +		pr_cont("\n");
>  	}
>
>  	for_each_populated_zone(zone) {
> @@ -4394,7 +4394,7 @@ void show_free_areas(unsigned int filter)
>  		if (skip_free_areas_node(filter, zone_to_nid(zone)))
>  			continue;
>  		show_node(zone);
> -		printk("%s: ", zone->name);
> +		pr_cont("%s: ", zone->name);
>
>  		spin_lock_irqsave(&zone->lock, flags);
>  		for (order = 0; order < MAX_ORDER; order++) {
> @@ -4412,11 +4412,11 @@ void show_free_areas(unsigned int filter)
>  		}
>  		spin_unlock_irqrestore(&zone->lock, flags);
>  		for (order = 0; order < MAX_ORDER; order++) {
> -			printk("%lu*%lukB ", nr[order], K(1UL) << order);
> +			pr_cont("%lu*%lukB ", nr[order], K(1UL) << order);
>  			if (nr[order])
>  				show_migration_types(types[order]);
>  		}
> -		printk("= %lukB\n", K(total));
> +		pr_cont("= %lukB\n", K(total));
>  	}
>
>  	hugetlb_show_meminfo();
>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm: pagealloc: fix continued prints in show_free_areas
  2016-10-18 13:00   ` Vlastimil Babka
@ 2016-10-18 13:04     ` Mark Rutland
  -1 siblings, 0 replies; 8+ messages in thread
From: Mark Rutland @ 2016-10-18 13:04 UTC (permalink / raw)
  To: Vlastimil Babka
  Cc: linux-kernel, Andrew Morton, Mel Gorman, linux-mm, Joe Perches,
	Michal Hocko

On Tue, Oct 18, 2016 at 03:00:40PM +0200, Vlastimil Babka wrote:
> On 10/18/2016 01:34 PM, Mark Rutland wrote:
> >In show_free_areas, we miss KERN_CONT in a few cases, and as a result
> >prints are unexpectedly split over a number of lines, making them
> >difficult to read (in v4.9-rc1).
> >
> >This patch uses pr_cont (with uits implicit KERN_CONT) to mark all
> >continued prints that occur withing a show_free_areas() call. Note that
> >show_migration_types() is only called by show_free_areas().
> >Depending on CONFIG_NUMA a printk after show_node() may or may not be a
> >continuation, but follows an explicit newline if not (and thus marking
> >it as a continuation should not be harmful).
> 
> I think this was already fixed:
> 
> http://marc.info/?l=linux-mm&m=147623910031630&w=2

So it was; thanks for the pointer!

Thanks,
Mark.

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

* Re: [PATCH] mm: pagealloc: fix continued prints in show_free_areas
@ 2016-10-18 13:04     ` Mark Rutland
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Rutland @ 2016-10-18 13:04 UTC (permalink / raw)
  To: Vlastimil Babka
  Cc: linux-kernel, Andrew Morton, Mel Gorman, linux-mm, Joe Perches,
	Michal Hocko

On Tue, Oct 18, 2016 at 03:00:40PM +0200, Vlastimil Babka wrote:
> On 10/18/2016 01:34 PM, Mark Rutland wrote:
> >In show_free_areas, we miss KERN_CONT in a few cases, and as a result
> >prints are unexpectedly split over a number of lines, making them
> >difficult to read (in v4.9-rc1).
> >
> >This patch uses pr_cont (with uits implicit KERN_CONT) to mark all
> >continued prints that occur withing a show_free_areas() call. Note that
> >show_migration_types() is only called by show_free_areas().
> >Depending on CONFIG_NUMA a printk after show_node() may or may not be a
> >continuation, but follows an explicit newline if not (and thus marking
> >it as a continuation should not be harmful).
> 
> I think this was already fixed:
> 
> http://marc.info/?l=linux-mm&m=147623910031630&w=2

So it was; thanks for the pointer!

Thanks,
Mark.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm: pagealloc: fix continued prints in show_free_areas
  2016-10-18 11:34 ` Mark Rutland
@ 2016-10-18 13:44   ` Michal Hocko
  -1 siblings, 0 replies; 8+ messages in thread
From: Michal Hocko @ 2016-10-18 13:44 UTC (permalink / raw)
  To: Mark Rutland
  Cc: linux-kernel, Andrew Morton, Vlastimil Babka, Mel Gorman, linux-mm

Already taken care of by
http://lkml.kernel.org/r/c7df37c8665134654a17aaeb8b9f6ace1d6db58b.1476239034.git.joe@perches.com
maybe it just fell through the cracks...

On Tue 18-10-16 12:34:17, Mark Rutland wrote:
> Recently, printk was reworked in commit:
> 
>   4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation
>   lines")
> 
> As of this commit, printk calls missing KERN_CONT will have a linebreak
> inserted implicitly.
> 
> In show_free_areas, we miss KERN_CONT in a few cases, and as a result
> prints are unexpectedly split over a number of lines, making them
> difficult to read (in v4.9-rc1).
> 
> This patch uses pr_cont (with uits implicit KERN_CONT) to mark all
> continued prints that occur withing a show_free_areas() call. Note that
> show_migration_types() is only called by show_free_areas().
> Depending on CONFIG_NUMA a printk after show_node() may or may not be a
> continuation, but follows an explicit newline if not (and thus marking
> it as a continuation should not be harmful).
> 
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Vlastimil Babka <vbabka@suse.cz>
> Cc: Mel Gorman <mgorman@techsingularity.net>
> Cc: linux-mm@kvack.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  mm/page_alloc.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 2b3bf67..833f271 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -4224,7 +4224,7 @@ static void show_migration_types(unsigned char type)
>  	}
>  
>  	*p = '\0';
> -	printk("(%s) ", tmp);
> +	pr_cont("(%s) ", tmp);
>  }
>  
>  /*
> @@ -4335,7 +4335,7 @@ void show_free_areas(unsigned int filter)
>  			free_pcp += per_cpu_ptr(zone->pageset, cpu)->pcp.count;
>  
>  		show_node(zone);
> -		printk("%s"
> +		pr_cont("%s"
>  			" free:%lukB"
>  			" min:%lukB"
>  			" low:%lukB"
> @@ -4382,8 +4382,8 @@ void show_free_areas(unsigned int filter)
>  			K(zone_page_state(zone, NR_FREE_CMA_PAGES)));
>  		printk("lowmem_reserve[]:");
>  		for (i = 0; i < MAX_NR_ZONES; i++)
> -			printk(" %ld", zone->lowmem_reserve[i]);
> -		printk("\n");
> +			pr_cont(" %ld", zone->lowmem_reserve[i]);
> +		pr_cont("\n");
>  	}
>  
>  	for_each_populated_zone(zone) {
> @@ -4394,7 +4394,7 @@ void show_free_areas(unsigned int filter)
>  		if (skip_free_areas_node(filter, zone_to_nid(zone)))
>  			continue;
>  		show_node(zone);
> -		printk("%s: ", zone->name);
> +		pr_cont("%s: ", zone->name);
>  
>  		spin_lock_irqsave(&zone->lock, flags);
>  		for (order = 0; order < MAX_ORDER; order++) {
> @@ -4412,11 +4412,11 @@ void show_free_areas(unsigned int filter)
>  		}
>  		spin_unlock_irqrestore(&zone->lock, flags);
>  		for (order = 0; order < MAX_ORDER; order++) {
> -			printk("%lu*%lukB ", nr[order], K(1UL) << order);
> +			pr_cont("%lu*%lukB ", nr[order], K(1UL) << order);
>  			if (nr[order])
>  				show_migration_types(types[order]);
>  		}
> -		printk("= %lukB\n", K(total));
> +		pr_cont("= %lukB\n", K(total));
>  	}
>  
>  	hugetlb_show_meminfo();
> -- 
> 1.9.1

-- 
Michal Hocko
SUSE Labs

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

* Re: [PATCH] mm: pagealloc: fix continued prints in show_free_areas
@ 2016-10-18 13:44   ` Michal Hocko
  0 siblings, 0 replies; 8+ messages in thread
From: Michal Hocko @ 2016-10-18 13:44 UTC (permalink / raw)
  To: Mark Rutland
  Cc: linux-kernel, Andrew Morton, Vlastimil Babka, Mel Gorman, linux-mm

Already taken care of by
http://lkml.kernel.org/r/c7df37c8665134654a17aaeb8b9f6ace1d6db58b.1476239034.git.joe@perches.com
maybe it just fell through the cracks...

On Tue 18-10-16 12:34:17, Mark Rutland wrote:
> Recently, printk was reworked in commit:
> 
>   4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation
>   lines")
> 
> As of this commit, printk calls missing KERN_CONT will have a linebreak
> inserted implicitly.
> 
> In show_free_areas, we miss KERN_CONT in a few cases, and as a result
> prints are unexpectedly split over a number of lines, making them
> difficult to read (in v4.9-rc1).
> 
> This patch uses pr_cont (with uits implicit KERN_CONT) to mark all
> continued prints that occur withing a show_free_areas() call. Note that
> show_migration_types() is only called by show_free_areas().
> Depending on CONFIG_NUMA a printk after show_node() may or may not be a
> continuation, but follows an explicit newline if not (and thus marking
> it as a continuation should not be harmful).
> 
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Vlastimil Babka <vbabka@suse.cz>
> Cc: Mel Gorman <mgorman@techsingularity.net>
> Cc: linux-mm@kvack.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  mm/page_alloc.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 2b3bf67..833f271 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -4224,7 +4224,7 @@ static void show_migration_types(unsigned char type)
>  	}
>  
>  	*p = '\0';
> -	printk("(%s) ", tmp);
> +	pr_cont("(%s) ", tmp);
>  }
>  
>  /*
> @@ -4335,7 +4335,7 @@ void show_free_areas(unsigned int filter)
>  			free_pcp += per_cpu_ptr(zone->pageset, cpu)->pcp.count;
>  
>  		show_node(zone);
> -		printk("%s"
> +		pr_cont("%s"
>  			" free:%lukB"
>  			" min:%lukB"
>  			" low:%lukB"
> @@ -4382,8 +4382,8 @@ void show_free_areas(unsigned int filter)
>  			K(zone_page_state(zone, NR_FREE_CMA_PAGES)));
>  		printk("lowmem_reserve[]:");
>  		for (i = 0; i < MAX_NR_ZONES; i++)
> -			printk(" %ld", zone->lowmem_reserve[i]);
> -		printk("\n");
> +			pr_cont(" %ld", zone->lowmem_reserve[i]);
> +		pr_cont("\n");
>  	}
>  
>  	for_each_populated_zone(zone) {
> @@ -4394,7 +4394,7 @@ void show_free_areas(unsigned int filter)
>  		if (skip_free_areas_node(filter, zone_to_nid(zone)))
>  			continue;
>  		show_node(zone);
> -		printk("%s: ", zone->name);
> +		pr_cont("%s: ", zone->name);
>  
>  		spin_lock_irqsave(&zone->lock, flags);
>  		for (order = 0; order < MAX_ORDER; order++) {
> @@ -4412,11 +4412,11 @@ void show_free_areas(unsigned int filter)
>  		}
>  		spin_unlock_irqrestore(&zone->lock, flags);
>  		for (order = 0; order < MAX_ORDER; order++) {
> -			printk("%lu*%lukB ", nr[order], K(1UL) << order);
> +			pr_cont("%lu*%lukB ", nr[order], K(1UL) << order);
>  			if (nr[order])
>  				show_migration_types(types[order]);
>  		}
> -		printk("= %lukB\n", K(total));
> +		pr_cont("= %lukB\n", K(total));
>  	}
>  
>  	hugetlb_show_meminfo();
> -- 
> 1.9.1

-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2016-10-18 13:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-18 11:34 [PATCH] mm: pagealloc: fix continued prints in show_free_areas Mark Rutland
2016-10-18 11:34 ` Mark Rutland
2016-10-18 13:00 ` Vlastimil Babka
2016-10-18 13:00   ` Vlastimil Babka
2016-10-18 13:04   ` Mark Rutland
2016-10-18 13:04     ` Mark Rutland
2016-10-18 13:44 ` Michal Hocko
2016-10-18 13:44   ` Michal Hocko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.