Add an MD callout like cpu_exit, but which is called after sched_lock is
obtained, when all other scheduling activity is suspended. This is needed on sparc64 to deactivate the vmspace of the exiting process on all cpus. Otherwise if another unrelated process gets the exact same vmspace structure allocated to it (same address), its address space will not be activated properly. This seems to fix some spontaneous signal 11 problems with smp on sparc64.
This commit is contained in:
parent
9ce4f54341
commit
8ba3d077ff
@ -247,6 +247,12 @@ cpu_exit(td)
|
||||
alpha_fpstate_drop(td);
|
||||
}
|
||||
|
||||
void
|
||||
cpu_sched_exit(td)
|
||||
register struct thread *td;
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
cpu_wait(p)
|
||||
struct proc *p;
|
||||
|
@ -282,6 +282,12 @@ cpu_exit(td)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
cpu_sched_exit(td)
|
||||
register struct thread *td;
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
cpu_wait(p)
|
||||
struct proc *p;
|
||||
|
@ -282,6 +282,12 @@ cpu_exit(td)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
cpu_sched_exit(td)
|
||||
register struct thread *td;
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
cpu_wait(p)
|
||||
struct proc *p;
|
||||
|
@ -313,6 +313,12 @@ cpu_exit(td)
|
||||
ia64_fpstate_drop(td);
|
||||
}
|
||||
|
||||
void
|
||||
cpu_sched_exit(td)
|
||||
register struct thread *td;
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
cpu_wait(p)
|
||||
struct proc *p;
|
||||
|
@ -448,6 +448,7 @@ exit1(td, rv)
|
||||
binuptime(PCPU_PTR(switchtime));
|
||||
PCPU_SET(switchticks, ticks);
|
||||
|
||||
cpu_sched_exit(td);
|
||||
cpu_throw();
|
||||
panic("exit1");
|
||||
}
|
||||
|
@ -208,6 +208,12 @@ cpu_exit(td)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
cpu_sched_exit(td)
|
||||
register struct thread *td;
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
cpu_wait(td)
|
||||
struct proc *td;
|
||||
|
@ -208,6 +208,12 @@ cpu_exit(td)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
cpu_sched_exit(td)
|
||||
register struct thread *td;
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
cpu_wait(td)
|
||||
struct proc *td;
|
||||
|
@ -86,6 +86,28 @@ cpu_exit(struct thread *td)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
cpu_sched_exit(struct thread *td)
|
||||
{
|
||||
struct vmspace *vm;
|
||||
struct pcpu *pc;
|
||||
struct proc *p;
|
||||
|
||||
mtx_assert(&sched_lock, MA_OWNED);
|
||||
|
||||
p = td->td_proc;
|
||||
vm = p->p_vmspace;
|
||||
if (vm->vm_refcnt > 1)
|
||||
return;
|
||||
SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
|
||||
if (pc->pc_vmspace == vm) {
|
||||
vm->vm_pmap.pm_active &= ~pc->pc_cpumask;
|
||||
vm->vm_pmap.pm_context[pc->pc_cpuid] = -1;
|
||||
pc->pc_vmspace = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Finish a fork operation, with process p2 nearly set up.
|
||||
* Copy and update the pcb, set up the stack so that the child
|
||||
|
@ -752,6 +752,7 @@ void userret(struct thread *, struct trapframe *, u_int);
|
||||
void maybe_resched(struct thread *);
|
||||
|
||||
void cpu_exit(struct thread *);
|
||||
void cpu_sched_exit(struct thread *);
|
||||
void exit1(struct thread *, int) __dead2;
|
||||
void cpu_fork(struct thread *, struct proc *, struct thread *, int);
|
||||
void cpu_set_fork_handler(struct thread *, void (*)(void *), void *);
|
||||
|
Loading…
x
Reference in New Issue
Block a user