Re: ABI change for device drivers using future AVX instruction set
From: H. Peter Anvin
Date: Sun Jun 29 2008 - 18:16:28 EST
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/