Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965974Ab2B1SfN (ORCPT ); Tue, 28 Feb 2012 13:35:13 -0500 Received: from mail-we0-f174.google.com ([74.125.82.174]:34773 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965107Ab2B1SfL convert rfc822-to-8bit (ORCPT ); Tue, 28 Feb 2012 13:35:11 -0500 MIME-Version: 1.0 In-Reply-To: <4F4D1857.4010706@redhat.com> References: <4F42FE08.5020309@zytor.com> <4F43DB69.9060509@zytor.com> <4F440945.1020904@zytor.com> <4F4CB89C.4060500@redhat.com> <4F4D0D18.4060409@redhat.com> <4F4D1857.4010706@redhat.com> From: Linus Torvalds Date: Tue, 28 Feb 2012 10:34:49 -0800 X-Google-Sender-Auth: 37PwmKExgMOdskW462t9lAVureQ Message-ID: Subject: Re: [PATCH 2/2] i387: split up into exported and internal interfaces To: Avi Kivity Cc: "H. Peter Anvin" , Josh Boyer , Jongman Heo , Thomas Gleixner , Ingo Molnar , x86@kernel.org, Linux Kernel Mailing List , KVM list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 974 Lines: 23 On Tue, Feb 28, 2012 at 10:09 AM, Avi Kivity wrote: > > This is done by preempt notifiers. ?Whenever a task switch happens we > push the guest fpu state into memory (if loaded) and let the normal > stuff happen. ?So the if we had a task switch during instruction > emulation, for example, then we'd get the "glacial and stupid path" to fire. Oh christ. This is exactly what the scheduler has ALWAYS ALREADY DONE FOR YOU. That's what the i387 save-and-restore code is all about. What's the advantage of just re-implementing it in non-obvious ways? Stop doing it. You get *zero* advantages from just doing what the scheduler natively does for you, and the scheduler does it *better*. 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/