diff options
| -rw-r--r-- | include/linux/init_task.h | 9 | ||||
| -rw-r--r-- | include/linux/sched.h | 2 | ||||
| -rw-r--r-- | kernel/sched.c | 2 |
3 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 1f8c06ce0fa..6ed8812bfe2 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
| @@ -12,6 +12,13 @@ | |||
| 12 | #include <linux/securebits.h> | 12 | #include <linux/securebits.h> |
| 13 | #include <net/net_namespace.h> | 13 | #include <net/net_namespace.h> |
| 14 | 14 | ||
| 15 | #ifdef CONFIG_SMP | ||
| 16 | # define INIT_PUSHABLE_TASKS(tsk) \ | ||
| 17 | .pushable_tasks = PLIST_NODE_INIT(tsk.pushable_tasks, MAX_PRIO), | ||
| 18 | #else | ||
| 19 | # define INIT_PUSHABLE_TASKS(tsk) | ||
| 20 | #endif | ||
| 21 | |||
| 15 | extern struct files_struct init_files; | 22 | extern struct files_struct init_files; |
| 16 | extern struct fs_struct init_fs; | 23 | extern struct fs_struct init_fs; |
| 17 | 24 | ||
| @@ -137,7 +144,7 @@ extern struct cred init_cred; | |||
| 137 | .nr_cpus_allowed = NR_CPUS, \ | 144 | .nr_cpus_allowed = NR_CPUS, \ |
| 138 | }, \ | 145 | }, \ |
| 139 | .tasks = LIST_HEAD_INIT(tsk.tasks), \ | 146 | .tasks = LIST_HEAD_INIT(tsk.tasks), \ |
| 140 | .pushable_tasks = PLIST_NODE_INIT(tsk.pushable_tasks, MAX_PRIO), \ | 147 | INIT_PUSHABLE_TASKS(tsk) \ |
| 141 | .ptraced = LIST_HEAD_INIT(tsk.ptraced), \ | 148 | .ptraced = LIST_HEAD_INIT(tsk.ptraced), \ |
| 142 | .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \ | 149 | .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \ |
| 143 | .real_parent = &tsk, \ | 150 | .real_parent = &tsk, \ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 9c2d46da486..4f92a239c14 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -1240,7 +1240,9 @@ struct task_struct { | |||
| 1240 | #endif | 1240 | #endif |
| 1241 | 1241 | ||
| 1242 | struct list_head tasks; | 1242 | struct list_head tasks; |
| 1243 | #ifdef CONFIG_SMP | ||
| 1243 | struct plist_node pushable_tasks; | 1244 | struct plist_node pushable_tasks; |
| 1245 | #endif | ||
| 1244 | 1246 | ||
| 1245 | struct mm_struct *mm, *active_mm; | 1247 | struct mm_struct *mm, *active_mm; |
| 1246 | #if defined(SPLIT_RSS_COUNTING) | 1248 | #if defined(SPLIT_RSS_COUNTING) |
diff --git a/kernel/sched.c b/kernel/sched.c index b646dad4a40..3925a1bbf5d 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
| @@ -2595,7 +2595,9 @@ void sched_fork(struct task_struct *p, int clone_flags) | |||
| 2595 | /* Want to start with kernel preemption disabled. */ | 2595 | /* Want to start with kernel preemption disabled. */ |
| 2596 | task_thread_info(p)->preempt_count = 1; | 2596 | task_thread_info(p)->preempt_count = 1; |
| 2597 | #endif | 2597 | #endif |
| 2598 | #ifdef CONFIG_SMP | ||
| 2598 | plist_node_init(&p->pushable_tasks, MAX_PRIO); | 2599 | plist_node_init(&p->pushable_tasks, MAX_PRIO); |
| 2600 | #endif | ||
| 2599 | 2601 | ||
| 2600 | put_cpu(); | 2602 | put_cpu(); |
| 2601 | } | 2603 | } |
