From owner-svn-src-all@FreeBSD.ORG Tue May 7 06:22:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C6004BC3; Tue, 7 May 2013 06:22:09 +0000 (UTC) (envelope-from gber@freebsd.org) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id 7DB2B182; Tue, 7 May 2013 06:22:09 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 5C39EEBDCD; Tue, 7 May 2013 08:22:08 +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 igltE1diWEFK; Tue, 7 May 2013 08:22:07 +0200 (CEST) Received: from [10.0.0.93] (cardhu.semihalf.com [213.17.239.108]) by smtp.semihalf.com (Postfix) with ESMTPSA id ACC0CEBDB4; Tue, 7 May 2013 08:22:07 +0200 (CEST) Message-ID: <5188B90A.7070205@freebsd.org> Date: Tue, 07 May 2013 10:19:22 +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: Adrian Chadd Subject: Re: svn commit: r250294 - head/sys/arm/arm References: <201305061427.r46ERlbV023243@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 06:22:09 -0000 In my opinion this is the simplest way to do it, however if you think it should be done other way I can change it. grzesiek On 05/06/13 20:45, Adrian Chadd wrote: > .. is this really the only way to do this reliably? > > > > adrian > > On 6 May 2013 07:27, Grzegorz Bernacki wrote: >> Author: gber >> Date: Mon May 6 14:27:46 2013 >> New Revision: 250294 >> URL: http://svnweb.freebsd.org/changeset/base/250294 >> >> Log: >> Avoid calling pcpu_init() simultaneously. >> >> pcpu_init() updates queue, so cannot be called by multiple cores >> at the same time >> >> Obtained from: Semihalf >> >> Modified: >> head/sys/arm/arm/mp_machdep.c >> >> Modified: head/sys/arm/arm/mp_machdep.c >> ============================================================================== >> --- head/sys/arm/arm/mp_machdep.c Mon May 6 14:12:36 2013 (r250293) >> +++ head/sys/arm/arm/mp_machdep.c Mon May 6 14:27:46 2013 (r250294) >> @@ -173,8 +173,15 @@ init_secondary(int cpu) >> >> pc =&__pcpu[cpu]; >> set_pcpu(pc); >> - pcpu_init(pc, cpu, sizeof(struct pcpu)); >> >> + /* >> + * pcpu_init() updates queue, so it should not be executed in parallel >> + * on several cores >> + */ >> + while(mp_naps< (cpu - 1)) >> + ; >> + >> + pcpu_init(pc, cpu, sizeof(struct pcpu)); >> dpcpu_init(dpcpu[cpu - 1], cpu); >> >> /* Provide stack pointers for other processor modes. */