Skip to contentSkip to conversation

vmstat: fix dirty threshold ordering

BUGFIX Wu Fengguang 3 participants 3 messages Nov 29, 2010 – Nov 30, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
---
 mm/vmstat.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/vmstat.c +2 -2
@@ -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>

Reviewed-by
#1 lore raw
Quoted 15 lines

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
Quoted 2 lines

Obviously. :-/

Thanks, Wu.

Quoted 26 lines
---
 mm/vmstat.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/vmstat.c +2 -3
@@ -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",
 
--
Quoted 5 lines

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>

--
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>

Reviewed-by
#2 lore raw
In reply to Wu Fengguang
Quoted 15 lines · Wu Fengguang

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

Quoted 2 lines
Signature · 9 lines
Kind regards,
Minchan Kim

--
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>