Messages in this thread | | | Date | Sun, 29 Jun 2008 15:08:22 -0700 | From | "H. Peter Anvin" <> | Subject | Re: ABI change for device drivers using future AVX instruction set |
| |
Andi Kleen wrote: >>> >> If you use xsave, I don't see how this is different to the user fpu save >> area. > > For once there's no clear error handling path for allocation failures > on the (arbitarily sized) xsave state. On user code that can be barely > tolerated, but for the kernel it would be deadly. >
Well, that's relatively easily dealt with... you'd have to allocate that state save area explicitly in kernel_fpu_begin(), and it would be up to the callers of that function to handle the resulting sleep and/or allocation failure -- we could even make kernel_fpu_begin() take a GFP_* flag.
Now, there are a few possibilities what to do with said state area. One is to make it associated with the task; if used for something as RAID, this would mean pretty soon *all* (or nearly all) tasks have such a state area, and we might as well go back to allocating them preemptively on thread creation. The other, of course, is to destroy it in kernel_fpu_end(). This may cause quite a bit of allocation/deallocation overhead, but perhaps this would be a decent use of a quicklist.
-hpa
| |