It's my understanding that the Linux kernel performs FPU-save/restore
for every "task" that it dispatches because it doesn't want to bother
trying to figure out if it needs the FPU or not.  Therefore, for
normal processes the FPU contents are always specific to the task that
"owns" the CPU and normal Linux "strongly discourages" kernel
processes from using the FPU by:
    1) providing no FPU services for save/restore
    2) providing (almost) no no-preemption guarantee so it's not even
safe for a (normal) kernel module to try to implement it itself
(unless, I guess, it's an ISR in a single CPU system which always
operates with interrupts disabled).
    It is for these reasons that RTLinux provides the FPU-attribute
for our real-time threads so we can do what the normal kernel can't
do.

    Norm




----- Original Message -----
From: Calin A. Culianu <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 26, 2001 2:13 AM
Subject: Re: [rtl] Should I setfp_np even I don't care about saving
FPU state?


> On Fri, 21 Dec 2001, Norm Dresner wrote:
>
> > Are you running X-window?  If so, there's probably be a large
number
> > of FP calculations you're unaware of.
> > Any sound cards?   Things like that are often stealth uses of
> > resources.
> >
> > The real question isn't having your thread's FP registers saved
for
> > it, but the possibility that your thread my corrupt the FPU state
of
> > any other process using it.
>
> Really?  I guess that makes sense, since really the linux kernel was
> completely pre-empted without its knowledge, and the thing that is
> responsible for restoring the cpu state so the kernel can resume
execution
> -- namely the rt-linux bits -- are operating under the assumption
that you
> "didn't under any circumstances touch the FPU" and thus they don't
bother
> restoring its state.  Makes perfect sense.. is this correct?
>
> -Calin
>
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/
>

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/

Reply via email to