From owner-svn-src-all@FreeBSD.ORG Mon May 6 18:45:49 2013 Return-Path: Delivered-To: svn-src-all@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 D3C18FC; Mon, 6 May 2013 18:45:49 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com [IPv6:2a00:1450:400c:c00::233]) by mx1.freebsd.org (Postfix) with ESMTP id E8E4FA8B; Mon, 6 May 2013 18:45:48 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id b13so3759844wgh.18 for ; Mon, 06 May 2013 11:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=5hBzZdTD0xEDcA1qdYuetWcVgXK1Tp56jAu1tSKJT+A=; b=LoV966a6uxtunYAKwAQsVzGz7jSEGOaZY8tabXDBjnUHQkleTzKlEG0xXNnhiUez7f Nv6YWo/ySxhjUami+++ygnQXwXswOfYNUtLLr0Uvde+a8NC5XNvoPnmXWNg/AzHJOxCR 5W17RSnCQFXhw8jrkrImRfSPrSodhJ0IakEsBbTf/iggUI1keSIz995NNOZb6MmT4gvT NWOfnq1vxyA/yMrA/Jlpt97bJ5tMTplnRLZ8PejaBeeCp9145zncCHcjj1XcHYxzDauz OBP6crqzvRPvAB878x4zYaEwnirywzSclBUu+1EgOzd6KajT+RfJt7haikRpBf1szYuw c97g== MIME-Version: 1.0 X-Received: by 10.180.93.134 with SMTP id cu6mr10226387wib.8.1367865948165; Mon, 06 May 2013 11:45:48 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.58.138 with HTTP; Mon, 6 May 2013 11:45:48 -0700 (PDT) In-Reply-To: <201305061427.r46ERlbV023243@svn.freebsd.org> References: <201305061427.r46ERlbV023243@svn.freebsd.org> Date: Mon, 6 May 2013 11:45:48 -0700 X-Google-Sender-Auth: 1atxt37qllJv-S3Uw_DSF4mg9xI Message-ID: Subject: Re: svn commit: r250294 - head/sys/arm/arm From: Adrian Chadd To: Grzegorz Bernacki Content-Type: text/plain; charset=ISO-8859-1 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: Mon, 06 May 2013 18:45:49 -0000 .. 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. */