From owner-freebsd-stable@freebsd.org Fri Sep 16 10:17:18 2016 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C18D8BDC491 for ; Fri, 16 Sep 2016 10:17:18 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73A50AC8; Fri, 16 Sep 2016 10:17:18 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bkqCo-000DxV-4X; Fri, 16 Sep 2016 13:17:14 +0300 Date: Fri, 16 Sep 2016 13:17:14 +0300 From: Slawa Olhovchenkov To: Konstantin Belousov Cc: John Baldwin , freebsd-stable@freebsd.org Subject: Re: nginx and FreeBSD11 Message-ID: <20160916101713.GA2840@zxy.spb.ru> References: <20160907191348.GD22212@zxy.spb.ru> <1823460.vTm8IvUQsF@ralph.baldwin.cx> <20160915174948.GW2840@zxy.spb.ru> <15357564.UUkYdbUZHc@ralph.baldwin.cx> <20160916091617.GT38409@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160916091617.GT38409@kib.kiev.ua> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 10:17:18 -0000 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. PS: vi regresion: can't exit from vi when no space on /tmp