lkml.org 
[lkml]   [2014]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] Make math_state_restore() save and restore the interrupt flag
From
On Sun, Feb 2, 2014 at 10:56 PM, Suresh Siddha <sbsiddha@gmail.com> wrote:
>
> Other patch which cleans up the irq_enable/disable logic in
> math_state_restore() has been sent yesterday. You can run your
> experiments with both these patches if you want. But your issue should
> get fixed with just the appended patch here.
>
> Peter, Please push both these patches through normal channels depending
> on the results.

Thinking about it some more, this patch is *almost* not needed at all.

I'm wondering if you should just change the first patch to just always
initialize the fpu when it is allocated, and at execve() time (ie in
flush_thread()).

If we do that, then this:

+ if (!tsk_used_math(tsk))
+ init_fpu(tsk);

can be dropped entirely from math_state_restore(). And quite frankly,
at that point, I think all the changes to __kernel_fpu_end() can go
away, because at that point math_state_restore() really does the right
thing - all the allocations are gone, and all the async task state
games are gone, only the "restore state" remains.

Hmm? So the only thing needed would be to add that "init_fpu()" to the
initial bootmem allocation path and to change flush_thread() (it
currently does "drop_init_fpu()", let's just make it initialize the
FPU state using fpu_finit()), and then we could remove the whole
"used_math" bit entirely, and just say that the FPU is always
initialized.

What do you guys think?

Linus


\
 
 \ /
  Last update: 2014-02-03 20:01    [W:0.127 / U:1.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site