aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/init_task.h9
-rw-r--r--include/linux/sched.h2
-rw-r--r--kernel/sched.c2
3 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 1f8c06ce0fa6..6ed8812bfe2d 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
15extern struct files_struct init_files; 22extern struct files_struct init_files;
16extern struct fs_struct init_fs; 23extern 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 9c2d46da486e..4f92a239c14d 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 b646dad4a40e..3925a1bbf5dd 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}