From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933236AbaHYRmD (ORCPT ); Mon, 25 Aug 2014 13:42:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41198 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933147AbaHYRmA (ORCPT ); Mon, 25 Aug 2014 13:42:00 -0400 Date: Mon, 25 Aug 2014 19:39:30 +0200 From: Oleg Nesterov To: Linus Torvalds Cc: Al Viro , Andrew Morton , Fenghua Yu , Suresh Siddha , Bean Anderson , "H. Peter Anvin" , Ingo Molnar , Thomas Gleixner , the arch/x86 maintainers , Linux Kernel Mailing List Subject: Re: [PATCH 2/5] x86, fpu: don't drop_fpu() in __restore_xstate_sig() if use_eager_fpu() Message-ID: <20140825173930.GA10376@redhat.com> References: <20140824194700.GA27281@redhat.com> <20140824194736.GA27441@redhat.com> <20140825144111.GB31880@redhat.com> <20140825170920.GA8338@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/25, Linus Torvalds wrote: > > On Mon, Aug 25, 2014 at 10:09 AM, Oleg Nesterov wrote: > > > > I'd like to change it only because this code is the main source of the > > nasty special case, used_math() and/or __thread_has_fpu(current) can be > > false even if use_eager_fpu(). > > Well, if you think it is correct (apart from missing preemption), then > I disagree *violently* with your "clean it up by restoring things > twice" model. OK. > The signal handling overhead of floating point restore is not small, > and it's not theoretical. Again, this only if 32bit && use_eager_fpu(), and use_eager_fpu() adds this overhead to every context switch. But you convinced me anyway. If this hack doesn't look "obviously safe and correct", lets forget it. I'll try to play with copy_from_user_in_atomic(), if nothing else just to complete the discussion and see how the code can look in this case. Thanks! Oleg.