From: arnd@arndb.de
To: linuxppc-dev@lists.ozlabs.org
Cc: Sean MacLennan <smaclennan@pikatech.com>
Subject: Re: Floating point in the kernel
Date: Thu, 10 Dec 2009 20:32:36 +0000 [thread overview]
Message-ID: <200912102032.36489.arnd@arndb.de> (raw)
In-Reply-To: <20091210131311.78cab78c@lappy.seanm.ca>
On Thursday 10 December 2009 18:13:11 Sean MacLennan wrote:
> One of our drivers has code that was originally running on a DSP. The
> code makes heavy use of floating point. We have isolated all the
> floating point to one kthread in the driver. Using enable_kernel_fp()
> this has worked well.
>
> But under a specific heavy RTP load, we started getting kernel panics.
> To make a long story short, the scheduler disables FP when you are
> context switched out. When you come back and access a FP instruction,
> you trap and call load_up_fpu() and everything is fine..... unless you
> are in the kernel. If you are in the kernel, like our kthread is, you
> get a "kernel FP unavailable exception".
I think the rule here is that you have to disable preemption and must not
call any potentially blocking functions like kmalloc when enable_kernel_fp
is set. The kernel has good control over whether a thread get context switched
or not, so it should be able to prevent these problems.
Arnd <><
prev parent reply other threads:[~2009-12-10 20:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-10 18:13 Floating point in the kernel Sean MacLennan
2009-12-10 20:19 ` Benjamin Herrenschmidt
2009-12-10 20:33 ` Sean MacLennan
2009-12-10 20:56 ` Benjamin Herrenschmidt
2009-12-10 21:35 ` Arnd Bergmann
2009-12-11 0:17 ` Sean MacLennan
2009-12-11 11:28 ` Arnd Bergmann
2009-12-10 20:32 ` arnd [this message]
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=200912102032.36489.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=smaclennan@pikatech.com \
/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).