[patch] smp-2.3.41-A1, (was: Re: BUG? i386 TLB Flushing)
Ingo Molnar
mingo en chiara.csoma.elte.hu
Lun Ene 24 23:34:48 CST 2000
On Mon, 24 Jan 2000, Stephen C. Tweedie wrote:
> > yeah, this is indeed a bug and it also explains the one remaining 64GB
> > mystery: the extra invlpg in highmem.c. Patch (with other SMP fixes) will
> > follow shortly.
>
> I was really, really hoping that this might lay to rest the boot
> failures with PAE36 for me, but no such luck --- 2.3.40 still dies with
> SIGSEGV in init. Zach Brown can reproduce the same thing on one of his
> boxes: Zach, does 2.3.40 do anything to help things for you?
ok, how about the attached smp-2.3.41-A1 patch:
- fixes dumb cr4 flushing typo found by Manfred
- (tries to fix) current->active_mm == NULL problem by moving the
setting of prev->active_mm to after the switch_to(). It happens
before has_cpu is set to 0, so it should be safe. It also cannot
open up a window to TLB corruption i believe.
-- mingo
------------ próxima parte ------------
--- linux/kernel/sched.c.orig Mon Jan 24 12:15:41 2000
+++ linux/kernel/sched.c Mon Jan 24 12:16:43 2000
@@ -412,6 +412,8 @@
static inline void __schedule_tail(struct task_struct *prev)
{
#ifdef __SMP__
+ if (!prev->mm)
+ prev->active_mm = NULL;
if ((prev->state == TASK_RUNNING) &&
(prev != idle_task(smp_processor_id()))) {
unsigned long flags;
@@ -586,10 +588,8 @@
switch_mm(oldmm, mm, next, this_cpu);
}
- if (!prev->mm) {
- prev->active_mm = NULL;
+ if (!prev->mm)
mmdrop(oldmm);
- }
}
/*
--- linux/include/asm-i386/pgtable.h.orig Mon Jan 24 12:10:19 2000
+++ linux/include/asm-i386/pgtable.h Mon Jan 24 12:10:33 2000
@@ -48,8 +48,8 @@
"mov %2, %%cr3; # flush TLB \n" \
"mov %1, %%cr4; # turn PGE back on \n" \
: \
- : "r" (mmu_cr4_features), \
- "r" (mmu_cr4_features & ~X86_CR4_PGE), \
+ : "r" (mmu_cr4_features & ~X86_CR4_PGE), \
+ "r" (mmu_cr4_features), \
"r" (__pa(current->active_mm->pgd)) \
: "memory"); \
} while (0)
Más información sobre la lista de distribución Ayuda