sched: fix the wrong mask_len
PATCH 1/1 sched: fix the wrong mask_len
If the NR_CPUS isn't a multiple of 32, we get a truncated string of sched domains by catting /proc/schedstat. This is caused by the wrong mask_len.
This patch fix it.
--- kernel/sched_stats.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/sched_stats.h +1 -1
@@ -9,7 +9,7 @@static int show_schedstat (struct seq_file *seq,void *v) {int cpu; -int mask_len =NR_CPUS /32 *9 ; +int mask_len = (NR_CPUS /32 +1 ) *9 ;char *mask_str =kmalloc (mask_len,GFP_KERNEL );if (mask_str ==NULL )
Signature · 1 line
1.5.4.rc3
Quoted 16 lines
If the
NR_CPUSisn't a multiple of 32, we get a truncated string of sched domains by catting/proc/schedstat. This is caused by the wrongmask_len.This patch fix it.
Signed-off-by Miao Xie <[email protected]>--- kernel/sched_stats.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)kernel/sched_stats.h +0
-0
kernel/sched_stats.h line 14
Quoted 7 lines
kernel/sched_stats.h +1
-1@@ -9,7 +9,7 @@static int show_schedstat (struct seq_file *seq,void *v) {int cpu; -int mask_len =NR_CPUS /32 *9 ; +int mask_len = (NR_CPUS /32 +1 ) *9 ;char *mask_str =kmalloc (mask_len,GFP_KERNEL );
DIV_ROUND_UP() is better?
Quoted 11 lines · KOSAKI Motohiro
Quoted 11 lines
If the
NR_CPUSisn't a multiple of 32, we get a truncated string of sched domains by catting/proc/schedstat. This is caused by the wrongmask_len.This patch fix it.
Signed-off-by Miao Xie <[email protected]>--- kernel/sched_stats.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 14 lines
kernel/sched_stats.h line 14
Quoted 12 lines
kernel/sched_stats.h +1
-1@@ -9,7 +9,7 @@static int show_schedstat (struct seq_file *seq,void *v) {int cpu; -int mask_len =NR_CPUS /32 *9 ; +int mask_len = (NR_CPUS /32 +1 ) *9 ;char *mask_str =kmalloc (mask_len,GFP_KERNEL );
DIV_ROUND_UP()is better?
Agreed
Quoted 27 lines · Peter Zijlstra
Quoted 11 lines · KOSAKI Motohiro
Quoted 11 lines
If the
NR_CPUSisn't a multiple of 32, we get a truncated string of sched domains by catting/proc/schedstat. This is caused by the wrongmask_len.This patch fix it.
Signed-off-by Miao Xie <[email protected]>--- kernel/sched_stats.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)Quoted 14 lines
kernel/sched_stats.h line 14
Quoted 12 lines
kernel/sched_stats.h +1
-1@@ -9,7 +9,7 @@static int show_schedstat (struct seq_file *seq,void *v) {int cpu; -int mask_len =NR_CPUS /32 *9 ; +int mask_len = (NR_CPUS /32 +1 ) *9 ;char *mask_str =kmalloc (mask_len,GFP_KERNEL );
DIV_ROUND_UP()is better?
Quoted 1 line
Agreed
---
Subject: sched: fix the wrong mask_len
From: Peter Zijlstra <[email protected]>
Date: Fri Oct 17 12:55:57 CEST 2008
If the NR_CPUS isn't a multiple of 32, we get a truncated string of sched domains by catting /proc/schedstat. This is caused by the wrong mask_len.
--- kernel/sched_stats.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched_stats.h +1 -1
@@ -9,7 +9,7 @@static int show_schedstat (struct seq_file *seq,void *v) {int cpu; -int mask_len =NR_CPUS /32 *9 ; +int mask_len =DIV_ROUND_UP (NR_CPUS ,32 ) *9 ;char *mask_str =kmalloc (mask_len,GFP_KERNEL );if (mask_str ==NULL )
KOSAKI Motohiro
Acked-byQuoted 19 lines
---
Subject: sched: fix the wrongmask_len
From: Peter Zijlstra <[email protected]>
Date: Fri Oct 17 12:55:57 CEST 2008If the
NR_CPUSisn't a multiple of 32, we get a truncated string of sched domains by catting/proc/schedstat. This is caused by the wrongmask_len.Reported-by Miao Xie <[email protected]>Signed-off-by Peter Zijlstra <[email protected]>--- kernel/sched_stats.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Index:
linux-2.6/kernel/sched_stats.h
===================================================================
kernel/sched_stats.h line 15
Quoted 8 lines
kernel/sched_stats.h +1
-1@@ -9,7 +9,7 @@static int show_schedstat (struct seq_file *seq,void *v) {int cpu; -int mask_len =NR_CPUS /32 *9 ; +int mask_len =DIV_ROUND_UP (NR_CPUS ,32 ) *9 ;char *mask_str =kmalloc (mask_len,GFP_KERNEL );if (mask_str ==NULL )
Ingo Molnar
AppliedQuoted 6 lines · Miao Xie
If the
NR_CPUSisn't a multiple of 32, we get a truncated string of sched domains by catting/proc/schedstat. This is caused by the wrongmask_len.This patch fix it.
Signed-off-by Miao Xie <[email protected]>
applied to tip/sched/urgent, thanks!
Ingo