From: Anton Blanchard <anton@samba.org>
To: torvalds@osdl.org
Cc: paulus@samba.org, torvalds@osdl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] [ppc64] Exception path optimisations
Date: Sat, 24 Jul 2004 22:59:37 +1000 [thread overview]
Message-ID: <20040724125937.GH4556@krispykreme> (raw)
- We were statically predicting syscalls would be 32bit which meant every
64bit syscall was guaranteed to be mispredicted. Just let the hardware
predict this one.
- We shouldnt use blrl for indirect function calls, it is unlikely to be
predicted correctly and corrupts the link prediction stack. We should
use bctrl instead.
- Statically predict a branch in the system call path, favouring calls from
userspace.
- Remove static prediction in pagefault path, hardware prediction should do
a better job here.
Signed-off-by: Anton Blanchard <anton@samba.org>
===== arch/ppc64/kernel/entry.S 1.41 vs edited =====
--- 1.41/arch/ppc64/kernel/entry.S Thu Jun 17 15:48:02 2004
+++ edited/arch/ppc64/kernel/entry.S Sat Jul 24 22:47:03 2004
@@ -132,7 +132,7 @@
*/
ld r11,.SYS_CALL_TABLE@toc(2)
andi. r10,r10,_TIF_32BIT
- beq- 15f
+ beq 15f
ld r11,.SYS_CALL_TABLE32@toc(2)
clrldi r3,r3,32
clrldi r4,r4,32
@@ -143,8 +143,8 @@
15:
slwi r0,r0,3
ldx r10,r11,r0 /* Fetch system call handler [ptr] */
- mtlr r10
- blrl /* Call handler */
+ mtctr r10
+ bctrl /* Call handler */
syscall_exit:
#ifdef SHOW_SYSCALLS
@@ -182,7 +182,7 @@
stdcx. r0,0,r1 /* to clear the reservation */
andi. r6,r8,MSR_PR
ld r4,_LINK(r1)
- beq 1f /* only restore r13 if */
+ beq- 1f /* only restore r13 if */
ld r13,GPR13(r1) /* returning to usermode */
1: ld r2,GPR2(r1)
ld r1,GPR1(r1)
===== arch/ppc64/kernel/head.S 1.67 vs edited =====
--- 1.67/arch/ppc64/kernel/head.S Mon Jul 5 20:27:11 2004
+++ edited/arch/ppc64/kernel/head.S Sat Jul 24 22:47:03 2004
@@ -1028,7 +1028,7 @@
bl .local_irq_restore
b 11f
#else
- beq+ fast_exception_return /* Return from exception on success */
+ beq fast_exception_return /* Return from exception on success */
/* fall through */
#endif
reply other threads:[~2004-07-24 13:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20040724125937.GH4556@krispykreme \
--to=anton@samba.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.org \
--cc=torvalds@osdl.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
all inboxes | Powered by JetHome®