.. | .. |
---|
11 | 11 | |
---|
12 | 12 | #ifdef CONFIG_SMP |
---|
13 | 13 | static int |
---|
14 | | -select_task_rq_stop(struct task_struct *p, int cpu, int sd_flag, int flags, |
---|
15 | | - int sibling_count_hint) |
---|
| 14 | +select_task_rq_stop(struct task_struct *p, int cpu, int sd_flag, int flags) |
---|
16 | 15 | { |
---|
17 | 16 | return task_cpu(p); /* stop tasks as never migrate */ |
---|
| 17 | +} |
---|
| 18 | + |
---|
| 19 | +static int |
---|
| 20 | +balance_stop(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) |
---|
| 21 | +{ |
---|
| 22 | + return sched_stop_runnable(rq); |
---|
18 | 23 | } |
---|
19 | 24 | #endif /* CONFIG_SMP */ |
---|
20 | 25 | |
---|
.. | .. |
---|
24 | 29 | /* we're never preempted */ |
---|
25 | 30 | } |
---|
26 | 31 | |
---|
27 | | -static struct task_struct * |
---|
28 | | -pick_next_task_stop(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) |
---|
| 32 | +static void set_next_task_stop(struct rq *rq, struct task_struct *stop, bool first) |
---|
29 | 33 | { |
---|
30 | | - struct task_struct *stop = rq->stop; |
---|
| 34 | + stop->se.exec_start = rq_clock_task(rq); |
---|
| 35 | +} |
---|
31 | 36 | |
---|
32 | | - if (!stop || !task_on_rq_queued(stop)) |
---|
| 37 | +static struct task_struct *pick_next_task_stop(struct rq *rq) |
---|
| 38 | +{ |
---|
| 39 | + if (!sched_stop_runnable(rq)) |
---|
33 | 40 | return NULL; |
---|
34 | 41 | |
---|
35 | | - put_prev_task(rq, prev); |
---|
36 | | - |
---|
37 | | - stop->se.exec_start = rq_clock_task(rq); |
---|
38 | | - |
---|
39 | | - return stop; |
---|
| 42 | + set_next_task_stop(rq, rq->stop, true); |
---|
| 43 | + return rq->stop; |
---|
40 | 44 | } |
---|
41 | 45 | |
---|
42 | 46 | static void |
---|
.. | .. |
---|
87 | 91 | { |
---|
88 | 92 | } |
---|
89 | 93 | |
---|
90 | | -static void set_curr_task_stop(struct rq *rq) |
---|
91 | | -{ |
---|
92 | | - struct task_struct *stop = rq->stop; |
---|
93 | | - |
---|
94 | | - stop->se.exec_start = rq_clock_task(rq); |
---|
95 | | -} |
---|
96 | | - |
---|
97 | 94 | static void switched_to_stop(struct rq *rq, struct task_struct *p) |
---|
98 | 95 | { |
---|
99 | 96 | BUG(); /* its impossible to change to this class */ |
---|
.. | .. |
---|
105 | 102 | BUG(); /* how!?, what priority? */ |
---|
106 | 103 | } |
---|
107 | 104 | |
---|
108 | | -static unsigned int |
---|
109 | | -get_rr_interval_stop(struct rq *rq, struct task_struct *task) |
---|
110 | | -{ |
---|
111 | | - return 0; |
---|
112 | | -} |
---|
113 | | - |
---|
114 | 105 | static void update_curr_stop(struct rq *rq) |
---|
115 | 106 | { |
---|
116 | 107 | } |
---|
.. | .. |
---|
118 | 109 | /* |
---|
119 | 110 | * Simple, special scheduling class for the per-CPU stop tasks: |
---|
120 | 111 | */ |
---|
121 | | -const struct sched_class stop_sched_class = { |
---|
122 | | - .next = &dl_sched_class, |
---|
| 112 | +const struct sched_class stop_sched_class |
---|
| 113 | + __section("__stop_sched_class") = { |
---|
123 | 114 | |
---|
124 | 115 | .enqueue_task = enqueue_task_stop, |
---|
125 | 116 | .dequeue_task = dequeue_task_stop, |
---|
.. | .. |
---|
129 | 120 | |
---|
130 | 121 | .pick_next_task = pick_next_task_stop, |
---|
131 | 122 | .put_prev_task = put_prev_task_stop, |
---|
| 123 | + .set_next_task = set_next_task_stop, |
---|
132 | 124 | |
---|
133 | 125 | #ifdef CONFIG_SMP |
---|
| 126 | + .balance = balance_stop, |
---|
134 | 127 | .select_task_rq = select_task_rq_stop, |
---|
135 | 128 | .set_cpus_allowed = set_cpus_allowed_common, |
---|
136 | 129 | #endif |
---|
137 | 130 | |
---|
138 | | - .set_curr_task = set_curr_task_stop, |
---|
139 | 131 | .task_tick = task_tick_stop, |
---|
140 | | - |
---|
141 | | - .get_rr_interval = get_rr_interval_stop, |
---|
142 | 132 | |
---|
143 | 133 | .prio_changed = prio_changed_stop, |
---|
144 | 134 | .switched_to = switched_to_stop, |
---|