public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] trim output of show_mem()
@ 2006-09-13 14:44 Jes Sorensen
  2006-09-13 15:03 ` Robin Holt
  2006-09-14 11:10 ` Jes Sorensen
  0 siblings, 2 replies; 3+ messages in thread
From: Jes Sorensen @ 2006-09-13 14:44 UTC (permalink / raw)
  To: linux-ia64

Hi,

This patch goes on top of the patch I posted earlier today. It trims
the number of lines of memory information output per node down from 5
lines to one line per node. Kinda helps if you have 1024 live nodes in
a system and you are dumping to the console :)

Cheers,
Jes

Cut the number of lines of memory info output per node from five
to one line.

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

---
 arch/ia64/mm/discontig.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

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
@@ -551,12 +551,13 @@ void show_mem(void)
 	show_free_areas();
 	printk(KERN_INFO "Free swap:       %6ldkB\n",
 	       nr_swap_pages<<(PAGE_SHIFT-10));
+	printk(KERN_INFO "Node memory in pages:\n");
 	for_each_online_pgdat(pgdat) {
 		unsigned long present;
 		unsigned long flags;
 		int shared = 0, cached = 0, reserved = 0;
 
-		printk(KERN_INFO "Node ID: %d\n", pgdat->node_id);
+		printk(KERN_INFO "Node %d:", pgdat->node_id);
 		pgdat_resize_lock(pgdat, &flags);
 		present = pgdat->node_present_pages;
 		for(i = 0; i < pgdat->node_spanned_pages; i++) {
@@ -580,10 +581,8 @@ void show_mem(void)
 		total_reserved += reserved;
 		total_cached += cached;
 		total_shared += shared;
-		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("\tRAM: %ld, reserved: %d, shared: %d, "
+		       "swap cached: %d\n", present, reserved, shared, cached);
 	}
 	printk(KERN_INFO "%ld pages of RAM\n", total_present);
 	printk(KERN_INFO "%d reserved pages\n", total_reserved);

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

* Re: [patch] trim output of show_mem()
  2006-09-13 14:44 [patch] trim output of show_mem() Jes Sorensen
@ 2006-09-13 15:03 ` Robin Holt
  2006-09-14 11:10 ` Jes Sorensen
  1 sibling, 0 replies; 3+ messages in thread
From: Robin Holt @ 2006-09-13 15:03 UTC (permalink / raw)
  To: linux-ia64

> This patch goes on top of the patch I posted earlier today. It trims
> the number of lines of memory information output per node down from 5
> lines to one line per node. Kinda helps if you have 1024 live nodes in

That is a great improvement!

> +		printk(KERN_INFO "Node %d:", pgdat->node_id);
...
> +		printk("\tRAM: %ld, reserved: %d, shared: %d, "
> +		       "swap cached: %d\n", present, reserved, shared, cached);

What about making these fixed width fields.

> +		printk(KERN_INFO "Node %4d: ", pgdat->node_id);
...
> +		printk("RAM: %11ld, rsvd: %8d, shrd: %10d, swpd: %10d\n",
> +				present, reserved, shared, cached);

Note, I changed the one tab to a space and abbreviated.  This puts things
into an 80 column display.  How would you feel about putting the two printks
together?

Thanks,
Robin

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

* Re: [patch] trim output of show_mem()
  2006-09-13 14:44 [patch] trim output of show_mem() Jes Sorensen
  2006-09-13 15:03 ` Robin Holt
@ 2006-09-14 11:10 ` Jes Sorensen
  1 sibling, 0 replies; 3+ messages in thread
From: Jes Sorensen @ 2006-09-14 11:10 UTC (permalink / raw)
  To: linux-ia64

>>>>> "Robin" = Robin Holt <holt@sgi.com> writes:

>> This patch goes on top of the patch I posted earlier today. It
>> trims the number of lines of memory information output per node
>> down from 5 lines to one line per node. Kinda helps if you have
>> 1024 live nodes in

Robin> That is a great improvement!

:-)

Robin> Note, I changed the one tab to a space and abbreviated.  This
Robin> puts things into an 80 column display.  How would you feel
Robin> about putting the two printks together?

Looks good to me, Tony will you take this one instead?

Tested and all ;)

Cheers,
Jes

Cut the number of lines of memory info output per node from five
to one line.

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

---
 arch/ia64/mm/discontig.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

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
@@ -551,12 +551,12 @@ void show_mem(void)
 	show_free_areas();
 	printk(KERN_INFO "Free swap:       %6ldkB\n",
 	       nr_swap_pages<<(PAGE_SHIFT-10));
+	printk(KERN_INFO "Node memory in pages:\n");
 	for_each_online_pgdat(pgdat) {
 		unsigned long present;
 		unsigned long flags;
 		int shared = 0, cached = 0, reserved = 0;
 
-		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++) {
@@ -580,10 +580,9 @@ void show_mem(void)
 		total_reserved += reserved;
 		total_cached += cached;
 		total_shared += shared;
-		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(KERN_INFO "Node %4d:  RAM: %11ld, rsvd: %8d, "
+		       "shrd: %10d, swpd: %10d\n", pgdat->node_id,
+		       present, reserved, shared, cached);
 	}
 	printk(KERN_INFO "%ld pages of RAM\n", total_present);
 	printk(KERN_INFO "%d reserved pages\n", total_reserved);

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

end of thread, other threads:[~2006-09-14 11:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-13 14:44 [patch] trim output of show_mem() Jes Sorensen
2006-09-13 15:03 ` Robin Holt
2006-09-14 11:10 ` Jes Sorensen

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