On Fri, Sep 16, 2016 at 01:17:14PM +0300, Slawa Olhovchenkov wrote:

> On Fri, Sep 16, 2016 at 12:16:17PM +0300, Konstantin Belousov wrote:
> 
> > 
> > vmspace_switch_aio() allows context switching with old curpmap
> > and new proc->p_vmspace. This is a weird condition, where
> > curproc->p_vmspace->vm_pmap is not equal to curcpu->pc_curpmap. I do
> > not see an obvious place which would immediately break, e.g. even
> > for context switch between assignment of newvm to p_vmspace and
> > pmap_activate(), the context-switch call to pmap_activate_sw() seems to
> > do right thing.
> > 
> > Still, just in case, try this
> > 
> > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
> > index a23468e..fbaa6c1 100644
> > --- a/sys/vm/vm_map.c
> > +++ b/sys/vm/vm_map.c
> > @@ -481,6 +481,7 @@ vmspace_switch_aio(struct vmspace *newvm)
> >     if (oldvm == newvm)
> >             return;
> >  
> > +   critical_enter();
> >     /*
> >      * Point to the new address space and refer to it.
> >      */
> > @@ -489,6 +490,7 @@ vmspace_switch_aio(struct vmspace *newvm)
> >  
> >     /* Activate the new mapping. */
> >     pmap_activate(curthread);
> > +   critical_exit();
> >  
> >     /* Remove the daemon's reference to the old address space. */
> >     KASSERT(oldvm->vm_refcnt > 1,
> 
> OK, nginx core dumped, kernel don't crushed.
> Now I am try this patch (critical_enter) and reboot.

nginx still core dumped.
_______________________________________________
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Reply via email to