From owner-freebsd-arm@FreeBSD.ORG Tue Apr 30 14:33:36 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 2E1B058E for ; Tue, 30 Apr 2013 14:33:36 +0000 (UTC) (envelope-from cognet@ci0.org) Received: from kanar.ci0.org (unknown [IPv6:2a01:e0b:1:150:ca0a:a9ff:fef1:a4c9]) by mx1.freebsd.org (Postfix) with ESMTP id AE1B2167A for ; Tue, 30 Apr 2013 14:33:35 +0000 (UTC) Received: from kanar.ci0.org (pluxor@localhost [127.0.0.1]) by kanar.ci0.org (8.14.5/8.14.5) with ESMTP id r3UEXB71072048; Tue, 30 Apr 2013 16:33:11 +0200 (CEST) (envelope-from cognet@ci0.org) Received: (from doginou@localhost) by kanar.ci0.org (8.14.5/8.14.5/Submit) id r3UEXBGh072047; Tue, 30 Apr 2013 16:33:11 +0200 (CEST) (envelope-from cognet@ci0.org) X-Authentication-Warning: kanar.ci0.org: doginou set sender to cognet@ci0.org using -f Date: Tue, 30 Apr 2013 16:33:11 +0200 From: Olivier Houchard To: Andrew Turner Subject: Re: RFC: Patches with AXP support and pmap&smp fixes. Message-ID: <20130430143311.GA71966@ci0.org> References: <517E8610.5050204@semihalf.com> <20130430142701.5bbfec2b@bender.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130430142701.5bbfec2b@bender.lan> User-Agent: Mutt/1.5.21 (2010-09-15) 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: Tue, 30 Apr 2013 14:33:36 -0000 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