diff options
Diffstat (limited to 'kernel/stop_machine.c')
-rw-r--r-- | kernel/stop_machine.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c index 84a9d18aa8da..dcfb5d731466 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c | |||
@@ -87,13 +87,9 @@ static int stop_machine(void) | |||
87 | { | 87 | { |
88 | int i, ret = 0; | 88 | int i, ret = 0; |
89 | struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 }; | 89 | struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 }; |
90 | mm_segment_t old_fs = get_fs(); | ||
91 | 90 | ||
92 | /* One high-prio thread per cpu. We'll do this one. */ | 91 | /* One high-prio thread per cpu. We'll do this one. */ |
93 | set_fs(KERNEL_DS); | 92 | sched_setscheduler(current, SCHED_FIFO, ¶m); |
94 | sys_sched_setscheduler(current->pid, SCHED_FIFO, | ||
95 | (struct sched_param __user *)¶m); | ||
96 | set_fs(old_fs); | ||
97 | 93 | ||
98 | atomic_set(&stopmachine_thread_ack, 0); | 94 | atomic_set(&stopmachine_thread_ack, 0); |
99 | stopmachine_num_threads = 0; | 95 | stopmachine_num_threads = 0; |
@@ -119,13 +115,12 @@ static int stop_machine(void) | |||
119 | return ret; | 115 | return ret; |
120 | } | 116 | } |
121 | 117 | ||
122 | /* Don't schedule us away at this point, please. */ | ||
123 | local_irq_disable(); | ||
124 | |||
125 | /* Now they are all started, make them hold the CPUs, ready. */ | 118 | /* Now they are all started, make them hold the CPUs, ready. */ |
119 | preempt_disable(); | ||
126 | stopmachine_set_state(STOPMACHINE_PREPARE); | 120 | stopmachine_set_state(STOPMACHINE_PREPARE); |
127 | 121 | ||
128 | /* Make them disable irqs. */ | 122 | /* Make them disable irqs. */ |
123 | local_irq_disable(); | ||
129 | stopmachine_set_state(STOPMACHINE_DISABLE_IRQ); | 124 | stopmachine_set_state(STOPMACHINE_DISABLE_IRQ); |
130 | 125 | ||
131 | return 0; | 126 | return 0; |
@@ -135,6 +130,7 @@ static void restart_machine(void) | |||
135 | { | 130 | { |
136 | stopmachine_set_state(STOPMACHINE_EXIT); | 131 | stopmachine_set_state(STOPMACHINE_EXIT); |
137 | local_irq_enable(); | 132 | local_irq_enable(); |
133 | preempt_enable_no_resched(); | ||
138 | } | 134 | } |
139 | 135 | ||
140 | struct stop_machine_data | 136 | struct stop_machine_data |