Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 May 2013 11:19:48 +0200
From:      Grzegorz Bernacki <gjb@semihalf.com>
To:        Olivier Houchard <cognet@ci0.org>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: RFC: Patches with AXP support and pmap&smp fixes.
Message-ID:  <518775B4.1010308@semihalf.com>
In-Reply-To: <20130430143311.GA71966@ci0.org>
References:  <517E8610.5050204@semihalf.com> <20130430142701.5bbfec2b@bender.lan> <20130430143311.GA71966@ci0.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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<gjb@semihalf.com>  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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?518775B4.1010308>