From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752610AbbCNK4h (ORCPT ); Sat, 14 Mar 2015 06:56:37 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44826 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751038AbbCNK4e (ORCPT ); Sat, 14 Mar 2015 06:56:34 -0400 Date: Sat, 14 Mar 2015 11:55:02 +0100 From: Borislav Petkov To: Oleg Nesterov Cc: Dave Hansen , Ingo Molnar , Andy Lutomirski , Linus Torvalds , Pekka Riikonen , Rik van Riel , Suresh Siddha , LKML , "Yu, Fenghua" , Quentin Casasnovas Subject: Re: [PATCH v2 4/4] x86/fpu: don't abuse drop_init_fpu() in flush_thread() Message-ID: <20150314105502.GB3114@pd.tnic> References: <54F74F59.5070107@intel.com> <20150311173346.GB5032@redhat.com> <20150311173507.GF5032@redhat.com> <20150313173030.GA31217@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150313173030.GA31217@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 13, 2015 at 06:30:30PM +0100, Oleg Nesterov wrote: > flush_thread() -> drop_init_fpu() is suboptimal and confusing. It does > drop_fpu() or restore_init_xstate() depending on !use_eager_fpu(). But > flush_thread() too checks eagerfpu right after that, and if it is true > then restore_init_xstate() just burns CPU for no reason. We are going to > load init_xstate_buf again after we set used_math/user_has_fpu, until > then the FPU state can't survive after switch_to(). > > Remove it, and change the "if (!use_eager_fpu())" to call drop_fpu(). > While at it, clean up the tsk/current usage. > > Signed-off-by: Oleg Nesterov Thanks, applied. Did a trivial cleanup ontop, see reply to this message. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --