linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] ARM: implement optimized percpu variable access
Date: Thu, 29 Nov 2012 15:26:52 +0000	[thread overview]
Message-ID: <20121129152651.GC19866@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <50B77B99.6070701@gmail.com>

On Thu, Nov 29, 2012 at 03:13:29PM +0000, Rob Herring wrote:
> On 11/29/2012 09:05 AM, Will Deacon wrote:
> > On Thu, Nov 29, 2012 at 02:52:44PM +0000, Rob Herring wrote:
> >> diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
> >> index fbc8b26..aadcca7 100644
> >> --- a/arch/arm/kernel/smp.c
> >> +++ b/arch/arm/kernel/smp.c
> >> @@ -296,6 +296,8 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
> >>  	struct mm_struct *mm = &init_mm;
> >>  	unsigned int cpu;
> >>  
> >> +	cpu_init();
> >> +
> >>  	/*
> >>  	 * The identity mapping is uncached (strongly ordered), so
> >>  	 * switch away from it before attempting any exclusive accesses.
> >> @@ -315,7 +317,6 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
> >>  
> >>  	printk("CPU%u: Booted secondary processor\n", cpu);
> >>  
> >> -	cpu_init();
> >>  	preempt_disable();
> >>  	trace_hardirqs_off();
> > 
> > It's really not safe moving the cpu_init that early because we're running
> > strongly ordered at that point, so locks aren't working.
> 
> I'll drop this hunk. Nicolas had concerns, but I've checked all the
> functions prior to cpu_init and don't see any percpu variable accesses.
> It could be an issue if we made current be a percpu var like x86-64, but
> I don't see any advantage to doing that.

I dunno, moving it before printk as Russell suggested is probably a good
idea as that code certainly isn't trivial and could easily tickle per-cpu
accesses in certain configurations.

Will

  reply	other threads:[~2012-11-29 15:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-29 14:52 [PATCH v2] ARM: implement optimized percpu variable access Rob Herring
2012-11-29 15:05 ` Will Deacon
2012-11-29 15:09   ` Russell King - ARM Linux
2012-11-29 15:13   ` Rob Herring
2012-11-29 15:26     ` Will Deacon [this message]
2012-11-29 15:48     ` Nicolas Pitre
2012-11-29 15:45 ` Nicolas Pitre
2012-11-29 15:53   ` Russell King - ARM Linux
2012-11-29 16:02     ` Nicolas Pitre
2012-11-29 16:06       ` Russell King - ARM Linux
2012-11-29 19:11 ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121129152651.GC19866@mudshark.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).