3 ms·
The scheduler already knows if you've used AVX or SSE instructions. You don't think they waste time backing up all those registers when you've never used them
by slededit 10y ago
The scheduler already knows if you've used AVX or SSE instructions. You don't think they waste time backing up all those registers when you've never used them do you?
You can set a flag causing an exception when an FPU instruction is used, and handle it by setting a flag saying you need to backup those registers.
You can also handle Undefined Operation exceptions by moving the thread to a core that can handle the specific instruction.
- gpderetta 10y agoIn practice any non trivial program will end up touching xmm registers as even plain memcpy ends up expanding to vectorized load/stores. Apparently lazy FPU restore in Linux is deprecated and eager restore is the default [1] [1] https://tthtlc.wordpress.com/2016/12/17/understanding-fpu-usage-in-linux-kernel/amp/ https://tthtlc.wordpress.com/2016/12/17/understanding-fpu-us...