From owner-freebsd-arm@FreeBSD.ORG Mon May 6 07:22:43 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DDEB3F56 for ; Mon, 6 May 2013 07:22:43 +0000 (UTC) (envelope-from gjb@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id 730CB682 for ; Mon, 6 May 2013 07:22:42 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 45BB4C8230; Mon, 6 May 2013 09:22:34 +0200 (CEST) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id 7U6Xp-4sVYIH; Mon, 6 May 2013 09:22:33 +0200 (CEST) Received: from [10.0.0.93] (cardhu.semihalf.com [213.17.239.108]) by smtp.semihalf.com (Postfix) with ESMTPSA id 78D91C5DF7; Mon, 6 May 2013 09:22:33 +0200 (CEST) Message-ID: <518775B4.1010308@semihalf.com> Date: Mon, 06 May 2013 11:19:48 +0200 From: Grzegorz Bernacki User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.24) Gecko/20120127 Thunderbird/3.1.16 MIME-Version: 1.0 To: Olivier Houchard Subject: Re: RFC: Patches with AXP support and pmap&smp fixes. References: <517E8610.5050204@semihalf.com> <20130430142701.5bbfec2b@bender.lan> <20130430143311.GA71966@ci0.org> In-Reply-To: <20130430143311.GA71966@ci0.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-arm@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 07:22:43 -0000 On 04/30/13 16:33, Olivier Houchard wrote: > On Tue, Apr 30, 2013 at 02:27:01PM +0100, Andrew Turner wrote: >> On Mon, 29 Apr 2013 16:39:12 +0200 >> Grzegorz Bernacki wrote: >> >>> Hi, >>> >>> I am going to submit some changes related to Armada XP support and >>> some general ARM fixes. You can find them at: >>> http://people.freebsd.org/~gber/armada >>> >>> It would be good if someone could review changes in generic ARM code >>> i.e.: 1) >>> http://people.freebsd.org/~gber/armada/0004-arm-smp-Fix-AP-processors-initialization-procedure.patch >>> >>> This patch fixes race condition in pcpu_init function. pcpu_init >>> performs operation on signly-linked tail queue and the queue can be >>> corrupted by secondary cpus initialization. >> >> > From this patch I can infer you have used FreeBSD ARM with SMP. Have >> you tried with WITNESS enabled? If not can you try? >> >> There is a known issue where accessing curthread is non-atomic when it >> is required to be. In it's current state mutexes may fail when they are >> unlocked. Olivier Houchard had a patch a few months ago to rework how >> the data is stored. My understanding is this helped but I have not seen >> or tried the patch. >> >> Olivier, is the above correct, and are we able to get this work into >> the tree so we can work on making SMP stable? >> >> Andrew > > Hi Andrew, > > That's true, the patch helped a lot, by storing curthread and curpcb on the > stack, and disabling interrupts while accessing less used pcpu entries. > However something was still wrong, after maybe between 30 minutes and 1 hour > of building port, I would get a random panic, usually from the VM, that I was > unable to diagnose so far. > I can dust of the patch, and share it anyway, even if it's still more a proof > of concept than anything else, if somebody is willing to work with me on the > remaining issues. > Also, it was my understanding that Semihalf also had an alternative patch to > solve the very same issue, did I get that wrong ? > > Regards, > > Olivier Hi, Our patch fixes only initialization of pcpu in pcpu_init(). In 4 cores setup it is possible the at least two cores simultaneously updating queue of pcpus which causes corruption. I am not aware of any other problems with SMP. Let us try setup with WITNESS enabled and we'll see if we have the same problem. Olivier, could you share your patch? In case we have the problem we would like to have it. thanks, grzesiek