Re: [PATCH] Make math_state_restore() save and restore the interrupt flag

From: Linus Torvalds
Date: Sat Feb 01 2014 - 15:16:51 EST


On Sat, Feb 1, 2014 at 12:00 PM, H. Peter Anvin <hpa@xxxxxxxxx> wrote:
> Of course, if we are really doing all eager fpu, we could just leave cr0.ts always clear and not touch it at all...

That's what the eager fpu code tries to do now (apart from process
initialization, I think). But the problem is that even disregarding
the process init issue, it saves and restores around every kernel FPU
use. What the extra flag (and task_work/do_resume_suspend) would do is
to just save/restore *once* per kernel entry.

Now, the *common* situation is certainly that the kernel doesn't do
any FPU work at all, but there are clearly exceptions to that. If
certain wireless encryption modes end up actually using hw
acceleration, we might have a *lot* of overhead from the save/restore
code. In fact, I think it triggers even for the idle task, which
doesn't really care.

Linus
--
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/