[3/3] powerpc: Avoid load hit store when using find_linux_pte_or_hugepte()

Michael Ellerman mpe at ellerman.id.au
Wed Jun 1 13:43:43 AEST 2016


On Sun, 2016-29-05 at 12:03:52 UTC, Anton Blanchard wrote:
> From: Anton Blanchard <anton at samba.org>
> 
> In many cases we disable interrupts right before calling
> find_linux_pte_or_hugepte().
> 
> find_linux_pte_or_hugepte() first checks interrupts are disabled
> before calling __find_linux_pte_or_hugepte():
> 
>         if (!arch_irqs_disabled()) {
>                 pr_info("%s called with irq enabled\n", __func__);
>                 dump_stack();
>         }
>         return __find_linux_pte_or_hugepte(pgdir, ea, is_thp, shift);
> 
> We know interrupts are disabled, but since the arch_irqs_*() macros
> are hidden from the compiler with inline assembly, gcc does not. We
> end up with a pretty awful load hit store:
> 
> 	li      r9,0
> 	lbz     r24,570(r13)
> 	stb     r9,570(r13)	<----
> 	lbz     r9,570(r13)	<---- ouch
> 	cmpdi   cr7,r9,0
> 	bne     cr7,c000000000049d30
> 
> Find these cases, and call __find_linux_pte_or_hugepte() directly.

I'd really rather __find_linux_pte_or_hugepte() was an internal detail, rather
than the standard API.

We do already have quite a few uses, but adding more just further spreads the
details about how the implementation works.

So I'm going to drop this in favor of Aneesh's patch to make irqs disabled check
a VM_WARN().

cheers


More information about the Linuxppc-dev mailing list