From: Arnd Bergmann <arnd.bergmann@de•ibm.com>
To: linuxppc-dev <Linuxppc-dev@ozlabs•org>
Cc: Paul Mackerras <paulus@samba•org>, cbe-oss-dev@ozlabs•org
Subject: powerpc: disable floating point exceptions for init
Date: Tue, 20 Jun 2006 02:30:33 +0200 [thread overview]
Message-ID: <200606200230.34348.arnd.bergmann@de.ibm.com> (raw)
Floating point exceptions should not be enabled by default,
as this setting impacts the performance on some CPUs, in
particular the Cell BE. Since the bits are inherited from
parent processes, the place to change the default is the
thread struct used for init.
glibc sets this up correctly per thread in its fesetenv
function, so user space should not be impacted by this
setting. None of the other common libc implementations
(uClibc, dietlibc, newlib, klibc) has support for fp
exceptions, so they are unlikely to be hit by this either.
There is a small risk that somebody wrote their own
application that manually sets the fpscr bits instead
of calling fesetenv, without changing the MSR bits as well.
Those programs will break with this change.
It probably makes sense to change glibc in the future
to be more clever about FE bits, so that when running
on a CPU where this is expensive, it disables exceptions
ASAP, while it keeps them enabled on CPUs where running
with exceptions on is cheaper than changing the state
often.
Signed-off-by: Arnd Bergmann <arnd.bergmann@de•ibm.com>
---
Index: linus-2.6/include/asm-powerpc/processor.h
===================================================================
--- linus-2.6.orig/include/asm-powerpc/processor.h
+++ linus-2.6/include/asm-powerpc/processor.h
@@ -190,7 +190,7 @@ struct thread_struct {
.fs = KERNEL_DS, \
.fpr = {0}, \
.fpscr = { .val = 0, }, \
- .fpexc_mode = MSR_FE0|MSR_FE1, \
+ .fpexc_mode = 0, \
}
#endif
reply other threads:[~2006-06-20 0:30 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=200606200230.34348.arnd.bergmann@de.ibm.com \
--to=arnd.bergmann@de$(echo .)ibm.com \
--cc=Linuxppc-dev@ozlabs$(echo .)org \
--cc=cbe-oss-dev@ozlabs$(echo .)org \
--cc=paulus@samba$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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