[PATCH v2] ARM: implement optimized percpu variable access

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Nov 29 11:06:44 EST 2012


On Thu, Nov 29, 2012 at 11:02:39AM -0500, Nicolas Pitre wrote:
> On Thu, 29 Nov 2012, Russell King - ARM Linux wrote:
> 
> > On Thu, Nov 29, 2012 at 10:45:50AM -0500, Nicolas Pitre wrote:
> > > On Thu, 29 Nov 2012, Rob Herring wrote:
> > > > Signed-off-by: Rob Herring <rob.herring at calxeda.com>
> > > > Acked-by: Will Deacon <will.deacon at arm.com>
> > > 
> > > With the above, and moving the call to cpu_init() after the call to 
> > > cpu_switch_mm(mm->pgd, mm) to fix Will's concerns (personally I'd put it 
> > > right after local_flush_tlb_all())... 
> > 
> > You're confused.  We were suggesting before the printk().
> > 
> > The reasoning is: printk() is not guaranteed not to access per-cpu
> > variables, so it needs to be before the first printk.  It can't be
> > before cpu_switch_mm(), and putting it before the TLB flush does
> > _not_ guarantee that TLB/MMU isn't going to still be seeing the
> > strongly-ordered attribute - so it _must_ be after the TLB flush.
> 
> But isn't that what I wrote above?  I said "personally I'd put it right 
> after local_flush_tlb_all()".

No it isn't.  No one was suggesting putting it after cpu_switch_mm() in
this thread other than your statement above.  _That_ is what provoked
me into replying because it was wrong and needed to be corrected before
we got a patch doing exactly that.



More information about the linux-arm-kernel mailing list