lkml.org 
[lkml]   [2008]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ABI change for device drivers using future AVX instruction set
Andi Kleen wrote:
>
>> list. I had to actually look into the source code of kernel_fpu_begin to
>> verify that it saves not only the FPU but also the XMM registers and
>> that it disables pre-emption.
>>
>
> The requirement to disable preemption is one reason why XMM in
> a driver is not a good idea BTW. XMM should be normally only
> used when you plan to spend a lot of CPU cycles (otherwise
> the cost of saving the state is not amortized by the improvements).
>
> But keeping preemption disabled for a long time is considered
> unfriendly because it increases kernel latencies and might
> in the worst case cause visible scheduling problems like skipping audio
> etc.
>

This is fixable. We could change kernel_fpu_begin() not to disable
preemption, but instead set a task flag. When we get the "no device"
fault, if the flag is set, save the fpu state into the kernel fpu save
area instead of the user fpu save area. Similar logic for restoring the
fpu state.

kvm runs with the guest fpu context while in the host kernel, using
preempt notifiers to achieve the same thing.

--
error compiling committee.c: too many arguments to function



\
 
 \ /
  Last update: 2008-06-29 13:35    [W:0.081 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site