2010-11-29 10:38:49

by Fengguang Wu

[permalink] [raw]
Subject: [BUGFIX] vmstat: fix dirty threshold ordering

The nr_dirty_[background_]threshold fields are misplaced before the
numa_* fields, and users will read strange values.

This is the right order. Before patch, nr_dirty_background_threshold
will read as 0 (the value from numa_miss).

numa_hit 128501
numa_miss 0
numa_foreign 0
numa_interleave 7388
numa_local 128501
numa_other 0
nr_dirty_threshold 144291
nr_dirty_background_threshold 72145

Cc: Michael Rubin <[email protected]>
Signed-off-by: Wu Fengguang <[email protected]>
---
mm/vmstat.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-next.orig/mm/vmstat.c 2010-11-28 16:02:12.000000000 +0800
+++ linux-next/mm/vmstat.c 2010-11-28 16:02:24.000000000 +0800
@@ -750,8 +750,6 @@ static const char * const vmstat_text[]
"nr_shmem",
"nr_dirtied",
"nr_written",
- "nr_dirty_threshold",
- "nr_dirty_background_threshold",

#ifdef CONFIG_NUMA
"numa_hit",
@@ -761,6 +759,8 @@ static const char * const vmstat_text[]
"numa_local",
"numa_other",
#endif
+ "nr_dirty_threshold",
+ "nr_dirty_background_threshold",

#ifdef CONFIG_VM_EVENT_COUNTERS
"pgpgin",


2010-11-29 11:21:43

by KOSAKI Motohiro

[permalink] [raw]
Subject: Re: [BUGFIX] vmstat: fix dirty threshold ordering

> The nr_dirty_[background_]threshold fields are misplaced before the
> numa_* fields, and users will read strange values.
>
> This is the right order. Before patch, nr_dirty_background_threshold
> will read as 0 (the value from numa_miss).
>
> numa_hit 128501
> numa_miss 0
> numa_foreign 0
> numa_interleave 7388
> numa_local 128501
> numa_other 0
> nr_dirty_threshold 144291
> nr_dirty_background_threshold 72145
>
> Cc: Michael Rubin <[email protected]>
> Signed-off-by: Wu Fengguang <[email protected]>

Obviously. :-/

Thanks, Wu.

Reviewed-by: KOSAKI Motohiro <[email protected]>


> ---
> mm/vmstat.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- linux-next.orig/mm/vmstat.c 2010-11-28 16:02:12.000000000 +0800
> +++ linux-next/mm/vmstat.c 2010-11-28 16:02:24.000000000 +0800
> @@ -750,8 +750,6 @@ static const char * const vmstat_text[]
> "nr_shmem",
> "nr_dirtied",
> "nr_written",
> - "nr_dirty_threshold",
> - "nr_dirty_background_threshold",
>
> #ifdef CONFIG_NUMA
> "numa_hit",
> @@ -761,6 +759,8 @@ static const char * const vmstat_text[]
> "numa_local",
> "numa_other",
> #endif
> + "nr_dirty_threshold",
> + "nr_dirty_background_threshold",
>
> #ifdef CONFIG_VM_EVENT_COUNTERS
> "pgpgin",
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to [email protected]. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
> Don't email: <a href=mailto:"[email protected]"> [email protected] </a>


2010-11-30 03:55:50

by Minchan Kim

[permalink] [raw]
Subject: Re: [BUGFIX] vmstat: fix dirty threshold ordering

On Mon, Nov 29, 2010 at 7:38 PM, Wu Fengguang <[email protected]> wrote:
> The nr_dirty_[background_]threshold fields are misplaced before the
> numa_* fields, and users will read strange values.
>
> This is the right order. Before patch, nr_dirty_background_threshold
> will read as 0 (the value from numa_miss).
>
> ? ? ? ?numa_hit 128501
> ? ? ? ?numa_miss 0
> ? ? ? ?numa_foreign 0
> ? ? ? ?numa_interleave 7388
> ? ? ? ?numa_local 128501
> ? ? ? ?numa_other 0
> ? ? ? ?nr_dirty_threshold 144291
> ? ? ? ?nr_dirty_background_threshold 72145
>
> Cc: Michael Rubin <[email protected]>
> Signed-off-by: Wu Fengguang <[email protected]>
Reviewed-by: Minchan Kim <[email protected]>

--
Kind regards,
Minchan Kim