public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] on memoryless node, /proc/pagetypeinfo is displayed slightly funny output.
@ 2008-04-29  7:40 KOSAKI Motohiro
  2008-04-29  8:12 ` Shi Weihua
  0 siblings, 1 reply; 5+ messages in thread
From: KOSAKI Motohiro @ 2008-04-29  7:40 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki, Mel Gorman, LKML, Andrew Morton; +Cc: kosaki.motohiro

Hi Mel,

I make patch of solve trivial pagetypeinfo problem.
please review it.


=================================================================
on memoryless node, /proc/pagetypeinfo is displayed slightly funny output.
this patch fix it.


output example (header is outputed, but no data is outputed)
--------------------------------------------------------------
Page block order: 14
Pages per block:  16384

Free pages count per migrate type at order       0      1      2      3      4      5    \
  6      7      8      9     10     11     12     13     14     15     16

Number of blocks type     Unmovable  Reclaimable      Movable      Reserve      Isolate
Page block order: 14
Pages per block:  16384

Free pages count per migrate type at order       0      1      2      3      4      5    \
  6      7      8      9     10     11     12     13     14     15     16


Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
CC: Mel Gorman <mel@csn.ul.ie>

---
 mm/vmstat.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: b/mm/vmstat.c
===================================================================
--- a/mm/vmstat.c       2008-04-29 16:48:58.000000000 +0900
+++ b/mm/vmstat.c       2008-04-29 16:58:33.000000000 +0900
@@ -638,6 +638,10 @@ static int pagetypeinfo_show(struct seq_
 {
        pg_data_t *pgdat = (pg_data_t *)arg;

+       /* check memoryless ndoe*/
+       if (!node_state(pgdat->node_id, N_HIGH_MEMORY))
+               return 0;
+
        seq_printf(m, "Page block order: %d\n", pageblock_order);
        seq_printf(m, "Pages per block:  %lu\n", pageblock_nr_pages);
        seq_putc(m, '\n');




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

* Re: [PATCH] on memoryless node, /proc/pagetypeinfo is displayed slightly funny output.
  2008-04-29  7:40 [PATCH] on memoryless node, /proc/pagetypeinfo is displayed slightly funny output KOSAKI Motohiro
@ 2008-04-29  8:12 ` Shi Weihua
  2008-04-29  8:17   ` [PATCH] on memoryless node, /proc/pagetypeinfo is displayed slightly funny output. take2 KOSAKI Motohiro
  0 siblings, 1 reply; 5+ messages in thread
From: Shi Weihua @ 2008-04-29  8:12 UTC (permalink / raw)
  To: KOSAKI Motohiro; +Cc: KAMEZAWA Hiroyuki, Mel Gorman, LKML, Andrew Morton

KOSAKI Motohiro wrote::
> Hi Mel,
> 
> I make patch of solve trivial pagetypeinfo problem.
> please review it.
> 
> 
> =================================================================
> on memoryless node, /proc/pagetypeinfo is displayed slightly funny output.
> this patch fix it.
> 
> 
> output example (header is outputed, but no data is outputed)
> --------------------------------------------------------------
> Page block order: 14
> Pages per block:  16384
> 
> Free pages count per migrate type at order       0      1      2      3      4      5    \
>   6      7      8      9     10     11     12     13     14     15     16
> 
> Number of blocks type     Unmovable  Reclaimable      Movable      Reserve      Isolate
> Page block order: 14
> Pages per block:  16384
> 
> Free pages count per migrate type at order       0      1      2      3      4      5    \
>   6      7      8      9     10     11     12     13     14     15     16
> 
> 
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> CC: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> CC: Mel Gorman <mel@csn.ul.ie>
> 
> ---
>  mm/vmstat.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> Index: b/mm/vmstat.c
> ===================================================================
> --- a/mm/vmstat.c       2008-04-29 16:48:58.000000000 +0900
> +++ b/mm/vmstat.c       2008-04-29 16:58:33.000000000 +0900
> @@ -638,6 +638,10 @@ static int pagetypeinfo_show(struct seq_
>  {
>         pg_data_t *pgdat = (pg_data_t *)arg;
> 
> +       /* check memoryless ndoe*/

ndoe -> node ?


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

* [PATCH] on memoryless node, /proc/pagetypeinfo is displayed slightly funny output.  take2
  2008-04-29  8:12 ` Shi Weihua
@ 2008-04-29  8:17   ` KOSAKI Motohiro
  2008-04-29 10:43     ` Mel Gorman
  0 siblings, 1 reply; 5+ messages in thread
From: KOSAKI Motohiro @ 2008-04-29  8:17 UTC (permalink / raw)
  To: Shi Weihua
  Cc: kosaki.motohiro, KAMEZAWA Hiroyuki, Mel Gorman, LKML,
	Andrew Morton

> > Index: b/mm/vmstat.c
> > ===================================================================
> > --- a/mm/vmstat.c       2008-04-29 16:48:58.000000000 +0900
> > +++ b/mm/vmstat.c       2008-04-29 16:58:33.000000000 +0900
> > @@ -638,6 +638,10 @@ static int pagetypeinfo_show(struct seq_
> >  {
> >         pg_data_t *pgdat = (pg_data_t *)arg;
> > 
> > +       /* check memoryless ndoe*/
> 
> ndoe -> node ?

Agghhh!
you are right ;-)

fixed version is here.


=================================================================
on memoryless node, /proc/pagetypeinfo is displayed slightly funny output.
this patch fix it.


output example (header is outputed, but no data is outputed)
--------------------------------------------------------------
Page block order: 14
Pages per block:  16384

Free pages count per migrate type at order       0      1      2      3      4      5    \
  6      7      8      9     10     11     12     13     14     15     16

Number of blocks type     Unmovable  Reclaimable      Movable      Reserve      Isolate
Page block order: 14
Pages per block:  16384

Free pages count per migrate type at order       0      1      2      3      4      5    \
  6      7      8      9     10     11     12     13     14     15     16


Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
CC: Mel Gorman <mel@csn.ul.ie>
---
 mm/vmstat.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: b/mm/vmstat.c
===================================================================
--- a/mm/vmstat.c       2008-04-29 16:48:58.000000000 +0900
+++ b/mm/vmstat.c       2008-04-29 16:58:33.000000000 +0900
@@ -638,6 +638,10 @@ static int pagetypeinfo_show(struct seq_
 {
        pg_data_t *pgdat = (pg_data_t *)arg;

+       /* check memoryless node */
+       if (!node_state(pgdat->node_id, N_HIGH_MEMORY))
+               return 0;
+
        seq_printf(m, "Page block order: %d\n", pageblock_order);
        seq_printf(m, "Pages per block:  %lu\n", pageblock_nr_pages);
        seq_putc(m, '\n');



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

* Re: [PATCH] on memoryless node, /proc/pagetypeinfo is displayed slightly funny output.  take2
  2008-04-29  8:17   ` [PATCH] on memoryless node, /proc/pagetypeinfo is displayed slightly funny output. take2 KOSAKI Motohiro
@ 2008-04-29 10:43     ` Mel Gorman
  2008-04-29 11:11       ` KOSAKI Motohiro
  0 siblings, 1 reply; 5+ messages in thread
From: Mel Gorman @ 2008-04-29 10:43 UTC (permalink / raw)
  To: KOSAKI Motohiro; +Cc: Shi Weihua, KAMEZAWA Hiroyuki, LKML, Andrew Morton

On (29/04/08 17:17), KOSAKI Motohiro didst pronounce:
> > > Index: b/mm/vmstat.c
> > > ===================================================================
> > > --- a/mm/vmstat.c       2008-04-29 16:48:58.000000000 +0900
> > > +++ b/mm/vmstat.c       2008-04-29 16:58:33.000000000 +0900
> > > @@ -638,6 +638,10 @@ static int pagetypeinfo_show(struct seq_
> > >  {
> > >         pg_data_t *pgdat = (pg_data_t *)arg;
> > > 
> > > +       /* check memoryless ndoe*/
> > 
> > ndoe -> node ?
> 
> Agghhh!
> you are right ;-)
> 
> fixed version is here.
> 

I see what you mean. The headers for a node with no populated zones looks
a bit odd. I was briefly thrown by the check for N_HIGH_MEMORY wondering
why it was not a check for N_NORMAL_MEMORY. A double-check showed that
N_NORMAL_MEMORY only has meaning on CONFIG_HIGHMEM machines and a check for
"any memory on the node" should use N_HIGH_MEMORY which is what you do.

So, your patch looks correct but unfortunately it is whitespace-damaged
and would not apply as-is. I included a whitespace-fixed version below for
convenience with a slightly clearer leader which I have acked.

Thanks

==========
On memoryless node, /proc/pagetypeinfo outputs headers for nodes with no
populated zones. This is confusing as shown in the following example.

>>>
Page block order: 14
Pages per block:  16384

Free pages count per migrate type at order       0      1      2      3      4      5      6      7      8      9     10     11     12     13     14     15     16

Number of blocks type     Unmovable  Reclaimable      Movable      Reserve      Isolate
Page block order: 14
Pages per block:  16384

Free pages count per migrate type at order       0      1      2      3      4      5      6      7      8      9     10     11     12     13     14     15     16
<SNIP>
<<<

Note the headers with no zone information. This patch checks if the node
has any memory before outputting anything.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
---
 mm/vmstat.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: b/mm/vmstat.c
===================================================================
--- a/mm/vmstat.c       2008-04-29 16:48:58.000000000 +0900
+++ b/mm/vmstat.c       2008-04-29 16:58:33.000000000 +0900
@@ -638,6 +638,10 @@ static int pagetypeinfo_show(struct seq_
 {
 	pg_data_t *pgdat = (pg_data_t *)arg;

+	/* check memoryless node */
+	if (!node_state(pgdat->node_id, N_HIGH_MEMORY))
+		return 0;
+
 	seq_printf(m, "Page block order: %d\n", pageblock_order);
 	seq_printf(m, "Pages per block:  %lu\n", pageblock_nr_pages);
 	seq_putc(m, '\n');


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

* Re: [PATCH] on memoryless node, /proc/pagetypeinfo is displayed slightly funny output.  take2
  2008-04-29 10:43     ` Mel Gorman
@ 2008-04-29 11:11       ` KOSAKI Motohiro
  0 siblings, 0 replies; 5+ messages in thread
From: KOSAKI Motohiro @ 2008-04-29 11:11 UTC (permalink / raw)
  To: Mel Gorman
  Cc: kosaki.motohiro, Shi Weihua, KAMEZAWA Hiroyuki, LKML,
	Andrew Morton

> I see what you mean. The headers for a node with no populated zones looks
> a bit odd. I was briefly thrown by the check for N_HIGH_MEMORY wondering
> why it was not a check for N_NORMAL_MEMORY. A double-check showed that
> N_NORMAL_MEMORY only has meaning on CONFIG_HIGHMEM machines and a check for
> "any memory on the node" should use N_HIGH_MEMORY which is what you do.
> 
> So, your patch looks correct but unfortunately it is whitespace-damaged
> and would not apply as-is. I included a whitespace-fixed version below for
> convenience with a slightly clearer leader which I have acked.

Oops, very sorry.
I'll check my MUA settings again.

and, very thank you for your excellent cleanups.




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

end of thread, other threads:[~2008-04-29 11:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-29  7:40 [PATCH] on memoryless node, /proc/pagetypeinfo is displayed slightly funny output KOSAKI Motohiro
2008-04-29  8:12 ` Shi Weihua
2008-04-29  8:17   ` [PATCH] on memoryless node, /proc/pagetypeinfo is displayed slightly funny output. take2 KOSAKI Motohiro
2008-04-29 10:43     ` Mel Gorman
2008-04-29 11:11       ` KOSAKI Motohiro

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