aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2008-04-08 14:43:03 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-19 13:44:59 -0400
commit39106dcf85285e78f3b290022122c76f851379b8 (patch)
tree7fe93aaf6a433920b1c31725f42db30799deaa55 /kernel
parentfb0f330e62d71f7c535251438068199af320cf73 (diff)
cpumask: use new cpus_scnprintf function
* Cleaned up references to cpumask_scnprintf() and added new cpulist_scnprintf() interfaces where appropriate. * Fix some small bugs (or code efficiency improvments) for various uses of cpumask_scnprintf. * Clean up some checkpatch errors. Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cpuset.c8
-rw-r--r--kernel/sched_stats.h8
2 files changed, 14 insertions, 2 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 6b9ac296a05c..b0c870b2ac30 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -2254,8 +2254,16 @@ void cpuset_task_status_allowed(struct seq_file *m, struct task_struct *task)
2254 m->count += cpumask_scnprintf(m->buf + m->count, m->size - m->count, 2254 m->count += cpumask_scnprintf(m->buf + m->count, m->size - m->count,
2255 task->cpus_allowed); 2255 task->cpus_allowed);
2256 seq_printf(m, "\n"); 2256 seq_printf(m, "\n");
2257 seq_printf(m, "Cpus_allowed_list:\t");
2258 m->count += cpulist_scnprintf(m->buf + m->count, m->size - m->count,
2259 task->cpus_allowed);
2260 seq_printf(m, "\n");
2257 seq_printf(m, "Mems_allowed:\t"); 2261 seq_printf(m, "Mems_allowed:\t");
2258 m->count += nodemask_scnprintf(m->buf + m->count, m->size - m->count, 2262 m->count += nodemask_scnprintf(m->buf + m->count, m->size - m->count,
2259 task->mems_allowed); 2263 task->mems_allowed);
2260 seq_printf(m, "\n"); 2264 seq_printf(m, "\n");
2265 seq_printf(m, "Mems_allowed_list:\t");
2266 m->count += nodelist_scnprintf(m->buf + m->count, m->size - m->count,
2267 task->mems_allowed);
2268 seq_printf(m, "\n");
2261} 2269}
diff --git a/kernel/sched_stats.h b/kernel/sched_stats.h
index 5b32433e7ee5..5bae2e0c3ff2 100644
--- a/kernel/sched_stats.h
+++ b/kernel/sched_stats.h
@@ -9,6 +9,11 @@
9static int show_schedstat(struct seq_file *seq, void *v) 9static int show_schedstat(struct seq_file *seq, void *v)
10{ 10{
11 int cpu; 11 int cpu;
12 int mask_len = NR_CPUS/32 * 9;
13 char *mask_str = kmalloc(mask_len, GFP_KERNEL);
14
15 if (mask_str == NULL)
16 return -ENOMEM;
12 17
13 seq_printf(seq, "version %d\n", SCHEDSTAT_VERSION); 18 seq_printf(seq, "version %d\n", SCHEDSTAT_VERSION);
14 seq_printf(seq, "timestamp %lu\n", jiffies); 19 seq_printf(seq, "timestamp %lu\n", jiffies);
@@ -36,9 +41,8 @@ static int show_schedstat(struct seq_file *seq, void *v)
36 preempt_disable(); 41 preempt_disable();
37 for_each_domain(cpu, sd) { 42 for_each_domain(cpu, sd) {
38 enum cpu_idle_type itype; 43 enum cpu_idle_type itype;
39 char mask_str[NR_CPUS];
40 44
41 cpumask_scnprintf(mask_str, NR_CPUS, sd->span); 45 cpumask_scnprintf(mask_str, mask_len, sd->span);
42 seq_printf(seq, "domain%d %s", dcount++, mask_str); 46 seq_printf(seq, "domain%d %s", dcount++, mask_str);
43 for (itype = CPU_IDLE; itype < CPU_MAX_IDLE_TYPES; 47 for (itype = CPU_IDLE; itype < CPU_MAX_IDLE_TYPES;
44 itype++) { 48 itype++) {