Date: Mon, 6 May 2013 11:45:48 -0700 From: Adrian Chadd <adrian@freebsd.org> To: Grzegorz Bernacki <gber@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r250294 - head/sys/arm/arm Message-ID: <CAJ-Vmom7Jj_0sBY7=skrWeyZeU-dQRL7C3E1BPJ5Wt_f2tL7FQ@mail.gmail.com> In-Reply-To: <201305061427.r46ERlbV023243@svn.freebsd.org> References: <201305061427.r46ERlbV023243@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
.. is this really the only way to do this reliably? adrian On 6 May 2013 07:27, Grzegorz Bernacki <gber@freebsd.org> 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. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmom7Jj_0sBY7=skrWeyZeU-dQRL7C3E1BPJ5Wt_f2tL7FQ>