Messages in this thread | | | Date | 8 Mar 2014 00:24:10 -0500 | From | "George Spelvin" <> | Subject | Re: [GIT PULL] x86 fixes for v3.14-rc6 |
| |
> The FPU stuff is still pending, I fear. I haven't heard anything from > Suresh so I suspect I'm going to have to dig into the init specifics > myself and fix up the patchset.
As I mentioned a couple of weeks ago in the "[PATCH] Make math_state_restore() save and restore the interrupt flag" thread, I've been running with just Suresh's second patch for the last month, and it's cured all my symptoms.
Although, just as a minor style point, I might reduce the number of levels if indentation by rewriting it as:
void __kernel_fpu_end(void) { - if (use_eager_fpu()) - math_state_restore(); - else + if (!use_eager_fpu()) { stts(); + } else if (likely(tsk_used_math(current))) + math_state_restore(); + } + /* + * When using eager fpu, tsk_used_math() is almost always true, + * and we restore the user math state eagerly. In some special + * cases during thread exit, signal handling etc, tsk_used_math() + * is false. Those few places will take proper actions, so we + * don't need to restore the math here. + */ } EXPORT_SYMBOL(__kernel_fpu_end);
Truthfully, the idea I like best is Linus's proposal to postpone all such adjustments to the processor state until the return to user space, so multiple kernel_fpu_begin()/_end() pairs become much cheaper: http://marc.info/?l=linux-kernel&m=139128398717816
Hoerver, that deep into Here Be Dragons code is somewhere I fear to tread, so I'm hoping someone braver than I is inspired.
| |