diff options
| -rw-r--r-- | kernel/sched/cpupri.c | 7 | ||||
| -rw-r--r-- | kernel/sched/cpupri.h | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/kernel/sched/cpupri.c b/kernel/sched/cpupri.c index 3031bac8aa3e..8834243abee2 100644 --- a/kernel/sched/cpupri.c +++ b/kernel/sched/cpupri.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <linux/gfp.h> | 30 | #include <linux/gfp.h> |
| 31 | #include <linux/sched.h> | 31 | #include <linux/sched.h> |
| 32 | #include <linux/sched/rt.h> | 32 | #include <linux/sched/rt.h> |
| 33 | #include <linux/slab.h> | ||
| 33 | #include "cpupri.h" | 34 | #include "cpupri.h" |
| 34 | 35 | ||
| 35 | /* Convert between a 140 based task->prio, and our 102 based cpupri */ | 36 | /* Convert between a 140 based task->prio, and our 102 based cpupri */ |
| @@ -218,8 +219,13 @@ int cpupri_init(struct cpupri *cp) | |||
| 218 | goto cleanup; | 219 | goto cleanup; |
| 219 | } | 220 | } |
| 220 | 221 | ||
| 222 | cp->cpu_to_pri = kcalloc(nr_cpu_ids, sizeof(int), GFP_KERNEL); | ||
| 223 | if (!cp->cpu_to_pri) | ||
| 224 | goto cleanup; | ||
| 225 | |||
| 221 | for_each_possible_cpu(i) | 226 | for_each_possible_cpu(i) |
| 222 | cp->cpu_to_pri[i] = CPUPRI_INVALID; | 227 | cp->cpu_to_pri[i] = CPUPRI_INVALID; |
| 228 | |||
| 223 | return 0; | 229 | return 0; |
| 224 | 230 | ||
| 225 | cleanup: | 231 | cleanup: |
| @@ -236,6 +242,7 @@ void cpupri_cleanup(struct cpupri *cp) | |||
| 236 | { | 242 | { |
| 237 | int i; | 243 | int i; |
| 238 | 244 | ||
| 245 | kfree(cp->cpu_to_pri); | ||
| 239 | for (i = 0; i < CPUPRI_NR_PRIORITIES; i++) | 246 | for (i = 0; i < CPUPRI_NR_PRIORITIES; i++) |
| 240 | free_cpumask_var(cp->pri_to_cpu[i].mask); | 247 | free_cpumask_var(cp->pri_to_cpu[i].mask); |
| 241 | } | 248 | } |
diff --git a/kernel/sched/cpupri.h b/kernel/sched/cpupri.h index f6d756173491..6b033347fdfd 100644 --- a/kernel/sched/cpupri.h +++ b/kernel/sched/cpupri.h | |||
| @@ -17,7 +17,7 @@ struct cpupri_vec { | |||
| 17 | 17 | ||
| 18 | struct cpupri { | 18 | struct cpupri { |
| 19 | struct cpupri_vec pri_to_cpu[CPUPRI_NR_PRIORITIES]; | 19 | struct cpupri_vec pri_to_cpu[CPUPRI_NR_PRIORITIES]; |
| 20 | int cpu_to_pri[NR_CPUS]; | 20 | int *cpu_to_pri; |
| 21 | }; | 21 | }; |
| 22 | 22 | ||
| 23 | #ifdef CONFIG_SMP | 23 | #ifdef CONFIG_SMP |
