Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933345AbaBAUQp (ORCPT ); Sat, 1 Feb 2014 15:16:45 -0500 Received: from mail-ve0-f169.google.com ([209.85.128.169]:60150 "EHLO mail-ve0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932074AbaBAUQn (ORCPT ); Sat, 1 Feb 2014 15:16:43 -0500 MIME-Version: 1.0 In-Reply-To: <74304a13-a3b1-451c-870e-034b66224dc4@email.android.com> References: <52ED4C96.6020703@zytor.com> <74304a13-a3b1-451c-870e-034b66224dc4@email.android.com> Date: Sat, 1 Feb 2014 12:16:42 -0800 X-Google-Sender-Auth: 2BVcfr5zEj2q0GqknToWGdFafS4 Message-ID: Subject: Re: [PATCH] Make math_state_restore() save and restore the interrupt flag From: Linus Torvalds To: "H. Peter Anvin" Cc: Suresh Siddha , Nate Eldredge , Thomas Gleixner , Ingo Molnar , "the arch/x86 maintainers" , stable , Linux Kernel Mailing List , Maarten Baert , Jan Kara , George Spelvin , Pekka Riikonen Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 1, 2014 at 12:00 PM, H. Peter Anvin 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/