From owner-svn-src-head@FreeBSD.ORG Thu May 12 11:40:47 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F28F1065672; Thu, 12 May 2011 11:40:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 311FD8FC1C; Thu, 12 May 2011 11:40:47 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id D8F5246B03; Thu, 12 May 2011 07:40:46 -0400 (EDT) Received: from John-Baldwins-Macbook-Pro.local (unknown [24.114.252.233]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3CB598A01B; Thu, 12 May 2011 07:40:46 -0400 (EDT) Message-ID: <4DCBC73D.9070006@FreeBSD.org> Date: Thu, 12 May 2011 07:40:45 -0400 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Andriy Gapon References: <201105091734.p49HY0P3006180@svn.freebsd.org> <20110512024956.996cd973.stas@FreeBSD.org> <4DCBB9EE.8070809@FreeBSD.org> <20110512035522.e42b379c.stas@FreeBSD.org> <4DCBBCBE.5020004@FreeBSD.org> <4DCBBEF5.4090004@FreeBSD.org> In-Reply-To: <4DCBBEF5.4090004@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 12 May 2011 07:40:46 -0400 (EDT) X-Mailman-Approved-At: Thu, 12 May 2011 12:02:01 +0000 Cc: src-committers@FreeBSD.org, neel@FreeBSD.org, svn-src-all@FreeBSD.org, Stanislav Sedov , svn-src-head@FreeBSD.org, Jung-uk Kim Subject: Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 11:40:47 -0000 On 5/12/11 7:05 AM, Andriy Gapon wrote: > on 12/05/2011 13:55 John Baldwin said the following: >> On 5/12/11 6:55 AM, Stanislav Sedov wrote: >>> On Thu, 12 May 2011 13:43:58 +0300 >>> Andriy Gapon mentioned: >>> >>>> >>>> Theory: >>>> - smp_rv_waiters[2] becomes equal to smp_rv_ncpus >>>> - [at least] one slave CPU is still in the last call to cpu_spinwait() in >>>> smp_rendezvous_action() >>>> - master CPU notices that the condition is true, exits smp_rendezvous_cpus() and >>>> calls it again >>>> - the slave CPU is still in spinwait >>>> - the master CPU resets smp_rv_waiters[2] to zero >>>> - the slave CPU exits spinwait, see smp_rv_waiters[2] with zero value >>>> - endless loop >>>> >>> >>> That might explain it. >>> Do you have a patch for me to try? >>> >>> Thanks! >>> >> >> The NetApp folks working on BHyVe also ran into this. They have a fix that I >> think sounds reasonable which is to add a generation count to the smp rendezvous >> "structure" and have waiting CPUs stop waiting if the generation count changes. >> > > This is an adaption of my patch in xcpu branch to head (not tested): Hmmm, this might be interesting. I think you want to always wait for this though even if you have a teardown function. -- John Baldwin