no SSE in kernel build?

John-Mark Gurney jmg at funkthat.com
Sat May 24 04:22:44 UTC 2014


Littlefield, Tyler wrote this message on Fri, May 23, 2014 at 22:05 -0400:
> Hello all:
> I had a quick question I was hoping someone could explain for me. I was 
> looking at some of the kernel source, just trying to familiarize myself 
> with it. I notice that SSE, MMX and other such instruction sets are 
> explicitly disabled during kernel compilation--is there any particular 
> reason why? I'm sure it's pretty obvious, but my knowledge of kernel 
> workings is pretty limited. I've seen functions like memset/memcpy that 
> make use of SSE and are incredibly fast; perhaps this could be useful on 
> architectures that support it?

The issue is that saving the entire FPU context on entry to the kernel
would be expensive even though most syscalls might not use the FPU
at all...

There are functions that enable the use of the FPU in your thread...
One example is the aesni module, as the AES-NI instructions use the
FPU/MMX registers...  I believe there is a screen saver or two that
also makes use of the FPU...

> Finally, I'm interested in doing some performance work on the 
> kernel--perhaps to help out somewhere. Is there anything at the kernel 
> level a beginner could help out with? Where else might my help be 
> useful? I know -some-, as I've worked a bit on a barebones OS, but I'm 
> no means a kernel hacker.

Have you familarized yourself w/ pmcstat/kcachegrind and dtrace?

As for specific areas, look on the mailing list for parts the people
think don't perform very well, and investigate...  There are lots of
different causes for performance issues from too many locking
operations, to bad algorithm choice, to bad use of large mallocs and
I'm sure there are other common issues in the kernel...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the freebsd-hackers mailing list