Commit 806c09a7 authored by Dario Faggioli's avatar Dario Faggioli Committed by Ingo Molnar

sched: Make pushable_tasks CONFIG_SMP dependant

As noted by Peter Zijlstra at https://lkml.org/lkml/2010/11/10/391
(while reviewing other stuff, though), tracking pushable tasks
only makes sense on SMP systems.
Signed-off-by: default avatarDario Faggioli <raistlin@linux.it>
Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Acked-by: default avatarGregory Haskins <ghaskins@novell.com>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1291143093.2697.298.camel@Palantir>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 8e9255e6
...@@ -12,6 +12,13 @@ ...@@ -12,6 +12,13 @@
#include <linux/securebits.h> #include <linux/securebits.h>
#include <net/net_namespace.h> #include <net/net_namespace.h>
#ifdef CONFIG_SMP
# define INIT_PUSHABLE_TASKS(tsk) \
.pushable_tasks = PLIST_NODE_INIT(tsk.pushable_tasks, MAX_PRIO),
#else
# define INIT_PUSHABLE_TASKS(tsk)
#endif
extern struct files_struct init_files; extern struct files_struct init_files;
extern struct fs_struct init_fs; extern struct fs_struct init_fs;
...@@ -137,7 +144,7 @@ extern struct cred init_cred; ...@@ -137,7 +144,7 @@ extern struct cred init_cred;
.nr_cpus_allowed = NR_CPUS, \ .nr_cpus_allowed = NR_CPUS, \
}, \ }, \
.tasks = LIST_HEAD_INIT(tsk.tasks), \ .tasks = LIST_HEAD_INIT(tsk.tasks), \
.pushable_tasks = PLIST_NODE_INIT(tsk.pushable_tasks, MAX_PRIO), \ INIT_PUSHABLE_TASKS(tsk) \
.ptraced = LIST_HEAD_INIT(tsk.ptraced), \ .ptraced = LIST_HEAD_INIT(tsk.ptraced), \
.ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \ .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \
.real_parent = &tsk, \ .real_parent = &tsk, \
......
...@@ -1240,7 +1240,9 @@ struct task_struct { ...@@ -1240,7 +1240,9 @@ struct task_struct {
#endif #endif
struct list_head tasks; struct list_head tasks;
#ifdef CONFIG_SMP
struct plist_node pushable_tasks; struct plist_node pushable_tasks;
#endif
struct mm_struct *mm, *active_mm; struct mm_struct *mm, *active_mm;
#if defined(SPLIT_RSS_COUNTING) #if defined(SPLIT_RSS_COUNTING)
......
...@@ -2595,7 +2595,9 @@ void sched_fork(struct task_struct *p, int clone_flags) ...@@ -2595,7 +2595,9 @@ void sched_fork(struct task_struct *p, int clone_flags)
/* Want to start with kernel preemption disabled. */ /* Want to start with kernel preemption disabled. */
task_thread_info(p)->preempt_count = 1; task_thread_info(p)->preempt_count = 1;
#endif #endif
#ifdef CONFIG_SMP
plist_node_init(&p->pushable_tasks, MAX_PRIO); plist_node_init(&p->pushable_tasks, MAX_PRIO);
#endif
put_cpu(); put_cpu();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment