parallel load of modules on an ARM multicore

Catalin Marinas catalin.marinas at arm.com
Thu Jun 23 11:34:24 EDT 2011


On Thu, Jun 23, 2011 at 04:12:49PM +0100, Russell King - ARM Linux wrote:
> On Thu, Jun 23, 2011 at 03:52:29PM +0100, Catalin Marinas wrote:
> > Peter,
> > 
> > On Thu, Jun 23, 2011 at 04:39:01PM +0200, EXTERNAL Waechtler Peter (Fa. TCP, CM-AI/PJ-CF31) wrote:
> > > it's interesting that you almost agree with me.
> > > 
> > > But isn't it really expensive to flush the icache on switch_mm?
> > > Is that meant as a test to see if the problem goes away?
> > 
> > Who said anything about flushing the icache on switch_mm()? My patch
> > doesn't do this, it actually reduces the amount of cache flushing on
> > ARM11MPCore.
> 
> Ahem, your patch does:
> 
> --- a/arch/arm/include/asm/mmu_context.h
> +++ b/arch/arm/include/asm/mmu_context.h
> @@ -114,7 +114,8 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next,
>  #ifdef CONFIG_SMP
>         /* check for possible thread migration */
>         if (!cpumask_empty(mm_cpumask(next)) &&
> -           !cpumask_test_cpu(cpu, mm_cpumask(next)))
> +           (cache_ops_need_broadcast() ||
> +            !cpumask_test_cpu(cpu, mm_cpumask(next))))
>                 __flush_icache_all();
>  #endif
>         if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next)) || prev != next) {
> 
> This means that if cache_ops_need_broadcast() is true, we will flush
> the I-cache at every MM context switch as very few MMs will have an
> empty mm_cpumask().

Ah, I forgot about this. That's left over from some earlier version of
the patch where cache_ops_need_broadcast() was set to 0 for ARMv6 SMP
but then I realised that it is still needed for some ptrace stuff and
re-instated it.

So this hunk is definitely not needed.

BTW, the patch (with the fix above) would be useful for the cases where
we have block drivers not calling flush_dcache_page().

-- 
Catalin



More information about the linux-arm-kernel mailing list