From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Anton Blanchard <anton@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] powerpc: inline ppc64_runlatch_off
Date: Fri, 06 Aug 2010 15:17:45 +1000 [thread overview]
Message-ID: <1281071865.2168.28.camel@pasglop> (raw)
In-Reply-To: <20100806045315.GR29316@kryten>
On Fri, 2010-08-06 at 14:53 +1000, Anton Blanchard wrote:
> I'm sick of seeing ppc64_runlatch_off in our profiles, so inline the
> heavily used part of it into the callers. To avoid a mess of circular includes
> I didn't add it as an inline function.
Considering that it's just an asm instruction or two, should we make it
inline asm and have it NOPed out instead using the feature sections ?
Cheers,
Ben.
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>
> Index: powerpc.git/arch/powerpc/include/asm/reg.h
> ===================================================================
> --- powerpc.git.orig/arch/powerpc/include/asm/reg.h 2010-08-04 19:55:38.910793475 +1000
> +++ powerpc.git/arch/powerpc/include/asm/reg.h 2010-08-04 20:20:19.490751850 +1000
> @@ -951,7 +951,14 @@
> #ifdef CONFIG_PPC64
>
> extern void ppc64_runlatch_on(void);
> -extern void ppc64_runlatch_off(void);
> +extern void __ppc64_runlatch_off(void);
> +
> +#define ppc64_runlatch_off() \
> + do { \
> + if (cpu_has_feature(CPU_FTR_CTRL) && \
> + test_thread_flag(TIF_RUNLATCH)) \
> + __ppc64_runlatch_off(); \
> + } while (0);
>
> extern unsigned long scom970_read(unsigned int address);
> extern void scom970_write(unsigned int address, unsigned long value);
> Index: powerpc.git/arch/powerpc/kernel/process.c
> ===================================================================
> --- powerpc.git.orig/arch/powerpc/kernel/process.c 2010-08-04 19:55:38.890747120 +1000
> +++ powerpc.git/arch/powerpc/kernel/process.c 2010-08-04 20:15:27.573241044 +1000
> @@ -1198,19 +1198,17 @@ void ppc64_runlatch_on(void)
> }
> }
>
> -void ppc64_runlatch_off(void)
> +void __ppc64_runlatch_off(void)
> {
> unsigned long ctrl;
>
> - if (cpu_has_feature(CPU_FTR_CTRL) && test_thread_flag(TIF_RUNLATCH)) {
> - HMT_medium();
> + HMT_medium();
>
> - clear_thread_flag(TIF_RUNLATCH);
> + clear_thread_flag(TIF_RUNLATCH);
>
> - ctrl = mfspr(SPRN_CTRLF);
> - ctrl &= ~CTRL_RUNLATCH;
> - mtspr(SPRN_CTRLT, ctrl);
> - }
> + ctrl = mfspr(SPRN_CTRLF);
> + ctrl &= ~CTRL_RUNLATCH;
> + mtspr(SPRN_CTRLT, ctrl);
> }
> #endif
>
next prev parent reply other threads:[~2010-08-06 5:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-06 4:53 [PATCH] powerpc: inline ppc64_runlatch_off Anton Blanchard
2010-08-06 5:17 ` Benjamin Herrenschmidt [this message]
2010-08-06 5:56 ` Anton Blanchard
2010-08-06 6:25 ` Benjamin Herrenschmidt
2010-08-06 6:51 ` Anton Blanchard
2010-08-06 8:02 ` Olof Johansson
2010-08-06 13:28 ` Anton Blanchard
2010-08-09 2:44 ` Olof Johansson
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=1281071865.2168.28.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=anton@samba.org \
--cc=linuxppc-dev@ozlabs.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).