Re: FPU emulator unsafe for SMP?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 19, 2002 at 08:24:34PM -0800, Jun Sun wrote:
> On Tue, Feb 19, 2002 at 10:28:35PM -0500, Greg Lindahl wrote:
> > 
> > Alpha seems to always save the fpu state (the comments say that gcc
> > always generates code that uses it in every user process.)
> >
> 
> I think the comment might be an execuse. :-)  Never heard of gcc
> generating unnecessary floating point code.

I have :)  It may do memory moves in them, for instance.  Not sure if
that makes sense on Alpha.

> > I suspect that the optimization of not saving the fpu state for a
> > process that doesn't use the fpu is the most critical optimization.
> > And that you do already.
> 
> If you do use floating point, I think it is pretty common to have
> only process that uses fpu and runs for very long.  In that case,
> leaving FPU owned by the process also saves quite a bit.

Not true.  For instance, on a processor with hardware FPU, setjmp()
will save FPU registers.  That means most processes will actually end
up taking the FPU at least once.


The general approach in Linux is to disable lazy switching on SMP.  I'm
95% sure that PowerPC does that.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux