patch-2.3.12 linux/kernel/sched.c
Next file: linux/lib/vsprintf.c
Previous file: linux/kernel/fork.c
Back to the patch index
Back to the overall index
- Lines: 48
- Date:
Wed Jul 28 10:45:39 1999
- Orig file:
v2.3.11/linux/kernel/sched.c
- Orig date:
Wed Jul 21 15:46:48 1999
diff -u --recursive --new-file v2.3.11/linux/kernel/sched.c linux/kernel/sched.c
@@ -621,15 +621,6 @@
*/
static inline void __schedule_tail(struct task_struct *prev)
{
- if (!current->active_mm) BUG();
-
- if (!prev->mm) {
- struct mm_struct *mm = prev->active_mm;
- if (mm) {
- prev->active_mm = NULL;
- mmdrop(mm);
- }
- }
#ifdef __SMP__
if ((prev->state == TASK_RUNNING) &&
(prev != idle_task(smp_processor_id())))
@@ -790,16 +781,26 @@
*/
{
struct mm_struct *mm = next->mm;
+ struct mm_struct *oldmm = prev->active_mm;
if (!mm) {
- mm = prev->active_mm;
- set_mmu_context(prev,next);
if (next->active_mm) BUG();
- next->active_mm = mm;
- atomic_inc(&mm->mm_count);
+ next->active_mm = oldmm;
+ atomic_inc(&oldmm->mm_count);
+ } else {
+ if (next->active_mm != mm) BUG();
+ switch_mm(oldmm, mm, this_cpu);
+ }
+
+ if (!prev->mm) {
+ prev->active_mm = NULL;
+ mmdrop(oldmm);
}
}
- get_mmu_context(next);
+ /*
+ * This just switches the register state and the
+ * stack.
+ */
switch_to(prev, next, prev);
__schedule_tail(prev);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)