public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] show_mem() printk levels
@ 2006-09-13 12:43 Jes Sorensen
  2006-09-13 17:28 ` Christoph Lameter
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jes Sorensen @ 2006-09-13 12:43 UTC (permalink / raw)
  To: linux-ia64

Hi,

This falls into the cosmetics department, but at least it makes us
consistent with other architectures.

Cheers,
Jes


Use the default sysrq printk level for printing show_mem() output both
for disconfig and contig versions. This is consistent with the printk
level used on other architectures (well ia32 at least).

Signed-off-by: Jes Sorensen <jes@sgi.com>

---
 arch/ia64/mm/contig.c    |   17 +++++++++--------
 arch/ia64/mm/discontig.c |   29 +++++++++++++++--------------
 2 files changed, 24 insertions(+), 22 deletions(-)

Index: linux-2.6/arch/ia64/mm/contig.c
=================================--- linux-2.6.orig/arch/ia64/mm/contig.c
+++ linux-2.6/arch/ia64/mm/contig.c
@@ -41,10 +41,11 @@ show_mem (void)
 	int i, total = 0, reserved = 0;
 	int shared = 0, cached = 0;
 
-	printk("Mem-info:\n");
+	printk(KERN_INFO "Mem-info:\n");
 	show_free_areas();
 
-	printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
+	printk(KERN_INFO "Free swap:       %6ldkB\n",
+	       nr_swap_pages<<(PAGE_SHIFT-10));
 	i = max_mapnr;
 	for (i = 0; i < max_mapnr; i++) {
 		if (!pfn_valid(i)) {
@@ -63,12 +64,12 @@ show_mem (void)
 		else if (page_count(mem_map + i))
 			shared += page_count(mem_map + i) - 1;
 	}
-	printk("%d pages of RAM\n", total);
-	printk("%d reserved pages\n", reserved);
-	printk("%d pages shared\n", shared);
-	printk("%d pages swap cached\n", cached);
-	printk("%ld pages in page table cache\n",
-		pgtable_quicklist_total_size());
+	printk(KERN_INFO "%d pages of RAM\n", total);
+	printk(KERN_INFO "%d reserved pages\n", reserved);
+	printk(KERN_INFO "%d pages shared\n", shared);
+	printk(KERN_INFO "%d pages swap cached\n", cached);
+	printk(KERN_INFO "%ld pages in page table cache\n",
+	       pgtable_quicklist_total_size());
 }
 
 /* physical address where the bootmem map is located */
Index: linux-2.6/arch/ia64/mm/discontig.c
=================================--- linux-2.6.orig/arch/ia64/mm/discontig.c
+++ linux-2.6/arch/ia64/mm/discontig.c
@@ -547,15 +547,16 @@ void show_mem(void)
 	unsigned long total_present = 0;
 	pg_data_t *pgdat;
 
-	printk("Mem-info:\n");
+	printk(KERN_INFO "Mem-info:\n");
 	show_free_areas();
-	printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
+	printk(KERN_INFO "Free swap:       %6ldkB\n",
+	       nr_swap_pages<<(PAGE_SHIFT-10));
 	for_each_online_pgdat(pgdat) {
 		unsigned long present;
 		unsigned long flags;
 		int shared = 0, cached = 0, reserved = 0;
 
-		printk("Node ID: %d\n", pgdat->node_id);
+		printk(KERN_INFO "Node ID: %d\n", pgdat->node_id);
 		pgdat_resize_lock(pgdat, &flags);
 		present = pgdat->node_present_pages;
 		for(i = 0; i < pgdat->node_spanned_pages; i++) {
@@ -579,18 +580,18 @@ void show_mem(void)
 		total_reserved += reserved;
 		total_cached += cached;
 		total_shared += shared;
-		printk("\t%ld pages of RAM\n", present);
-		printk("\t%d reserved pages\n", reserved);
-		printk("\t%d pages shared\n", shared);
-		printk("\t%d pages swap cached\n", cached);
+		printk(KERN_INFO "\t%ld pages of RAM\n", present);
+		printk(KERN_INFO "\t%d reserved pages\n", reserved);
+		printk(KERN_INFO "\t%d pages shared\n", shared);
+		printk(KERN_INFO "\t%d pages swap cached\n", cached);
 	}
-	printk("%ld pages of RAM\n", total_present);
-	printk("%d reserved pages\n", total_reserved);
-	printk("%d pages shared\n", total_shared);
-	printk("%d pages swap cached\n", total_cached);
-	printk("Total of %ld pages in page table cache\n",
-		pgtable_quicklist_total_size());
-	printk("%d free buffer pages\n", nr_free_buffer_pages());
+	printk(KERN_INFO "%ld pages of RAM\n", total_present);
+	printk(KERN_INFO "%d reserved pages\n", total_reserved);
+	printk(KERN_INFO "%d pages shared\n", total_shared);
+	printk(KERN_INFO "%d pages swap cached\n", total_cached);
+	printk(KERN_INFO "Total of %ld pages in page table cache\n",
+	       pgtable_quicklist_total_size());
+	printk(KERN_INFO "%d free buffer pages\n", nr_free_buffer_pages());
 }
 
 /**

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

* Re: [patch] show_mem() printk levels
  2006-09-13 12:43 [patch] show_mem() printk levels Jes Sorensen
@ 2006-09-13 17:28 ` Christoph Lameter
  2006-09-14  8:27 ` Jes Sorensen
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Christoph Lameter @ 2006-09-13 17:28 UTC (permalink / raw)
  To: linux-ia64

On Wed, 13 Sep 2006, Jes Sorensen wrote:

> Index: linux-2.6/arch/ia64/mm/contig.c
> =================================> --- linux-2.6.orig/arch/ia64/mm/contig.c
> +++ linux-2.6/arch/ia64/mm/contig.c
>  
> -	printk("Mem-info:\n");
> +	printk(KERN_INFO "Mem-info:\n");
>  	show_free_areas();

^^^ This will print 1 mio cpuset descriptions on a 1k cpu / 1k node 
system to the console. Could we just drop calling show_free_areas()?

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

* Re: [patch] show_mem() printk levels
  2006-09-13 12:43 [patch] show_mem() printk levels Jes Sorensen
  2006-09-13 17:28 ` Christoph Lameter
@ 2006-09-14  8:27 ` Jes Sorensen
  2006-09-14 16:47 ` Christoph Lameter
  2006-09-21 12:40 ` Jes Sorensen
  3 siblings, 0 replies; 5+ messages in thread
From: Jes Sorensen @ 2006-09-14  8:27 UTC (permalink / raw)
  To: linux-ia64

>>>>> "Christoph" = Christoph Lameter <clameter@sgi.com> writes:

Christoph> On Wed, 13 Sep 2006, Jes Sorensen wrote:
>> Index: linux-2.6/arch/ia64/mm/contig.c
>> =================================>> --- linux-2.6.orig/arch/ia64/mm/contig.c +++
>> linux-2.6/arch/ia64/mm/contig.c
>> 
>> - printk("Mem-info:\n"); + printk(KERN_INFO "Mem-info:\n");
>> show_free_areas();

Christoph> ^^^ This will print 1 mio cpuset descriptions on a 1k cpu /
Christoph> 1k node system to the console. Could we just drop calling
Christoph> show_free_areas()?

Actually it's far worse than that if I got the math right, it will
print in the order of 2 * NR_CPUS * NR_NODES * nr_zones, which for a
machine with 1024 cpus and 1024 nodes will result in 2 million lines
plus a bit of other noise.

This is a problem on all architectures, not just ia64, so I have a
patch to try and trim that down too, so it gets done right. But we may
also want to consider dropping the call altogether for ia64 or maybe
if the number of nodes is larger than a certain amount (but I don't
like inconsistent behavior depending on the size of a system).

Anyway, I am not done sending out patches :)

Cheers,
Jes

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

* Re: [patch] show_mem() printk levels
  2006-09-13 12:43 [patch] show_mem() printk levels Jes Sorensen
  2006-09-13 17:28 ` Christoph Lameter
  2006-09-14  8:27 ` Jes Sorensen
@ 2006-09-14 16:47 ` Christoph Lameter
  2006-09-21 12:40 ` Jes Sorensen
  3 siblings, 0 replies; 5+ messages in thread
From: Christoph Lameter @ 2006-09-14 16:47 UTC (permalink / raw)
  To: linux-ia64

On Thu, 14 Sep 2006, Jes Sorensen wrote:

> 
> Actually it's far worse than that if I got the math right, it will
> print in the order of 2 * NR_CPUS * NR_NODES * nr_zones, which for a
> machine with 1024 cpus and 1024 nodes will result in 2 million lines
> plus a bit of other noise.
> 
> This is a problem on all architectures, not just ia64, so I have a
> patch to try and trim that down too, so it gets done right. But we may
> also want to consider dropping the call altogether for ia64 or maybe
> if the number of nodes is larger than a certain amount (but I don't
> like inconsistent behavior depending on the size of a system).

Please lets just drop the call for ia64. For systems with a few cpus 
(typical for Linux use) the diagnostics are very useful.


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

* Re: [patch] show_mem() printk levels
  2006-09-13 12:43 [patch] show_mem() printk levels Jes Sorensen
                   ` (2 preceding siblings ...)
  2006-09-14 16:47 ` Christoph Lameter
@ 2006-09-21 12:40 ` Jes Sorensen
  3 siblings, 0 replies; 5+ messages in thread
From: Jes Sorensen @ 2006-09-21 12:40 UTC (permalink / raw)
  To: linux-ia64

Christoph Lameter wrote:
> On Thu, 14 Sep 2006, Jes Sorensen wrote:
> 
>> Actually it's far worse than that if I got the math right, it will
>> print in the order of 2 * NR_CPUS * NR_NODES * nr_zones, which for a
>> machine with 1024 cpus and 1024 nodes will result in 2 million lines
>> plus a bit of other noise.
>>
>> This is a problem on all architectures, not just ia64, so I have a
>> patch to try and trim that down too, so it gets done right. But we may
>> also want to consider dropping the call altogether for ia64 or maybe
>> if the number of nodes is larger than a certain amount (but I don't
>> like inconsistent behavior depending on the size of a system).
> 
> Please lets just drop the call for ia64. For systems with a few cpus 
> (typical for Linux use) the diagnostics are very useful.

I'm fine with this - anybody objecting to this call being dropped for
ia64? We could do something where we only call it if the number of nodes
is lower than a certain threshold, but IMHO it's better to be
consistent?

Comments,
Jes


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

end of thread, other threads:[~2006-09-21 12:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-13 12:43 [patch] show_mem() printk levels Jes Sorensen
2006-09-13 17:28 ` Christoph Lameter
2006-09-14  8:27 ` Jes Sorensen
2006-09-14 16:47 ` Christoph Lameter
2006-09-21 12:40 ` Jes Sorensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox