[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFyrUTshLPk=21H+6ySOeEVS_zVUAK=2QPrq0aqdQ=3_zg@mail.gmail.com>
Date: Mon, 3 Feb 2014 10:20:19 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Suresh Siddha <sbsiddha@...il.com>
Cc: Nate Eldredge <nate@...tsmathematics.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
"the arch/x86 maintainers" <x86@...nel.org>,
stable <stable@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Maarten Baert <maarten-baert@...mail.com>,
Jan Kara <jack@...e.cz>, George Spelvin <linux@...izon.com>,
Pekka Riikonen <priikone@....fi>
Subject: Re: [PATCH] Make math_state_restore() save and restore the interrupt flag
On Sun, Feb 2, 2014 at 10:56 PM, Suresh Siddha <sbsiddha@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists