From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758000AbbA2VJI (ORCPT ); Thu, 29 Jan 2015 16:09:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33199 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757892AbbA2VJG (ORCPT ); Thu, 29 Jan 2015 16:09:06 -0500 Date: Thu, 29 Jan 2015 22:07:52 +0100 From: Oleg Nesterov To: Rik van Riel , Dave Hansen Cc: Suresh Siddha , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Fenghua Yu , the arch/x86 maintainers , linux-kernel Subject: [PATCH 1/3] x86, fpu: unlazy_fpu: don't reset thread.fpu_counter Message-ID: <20150129210752.GB31584@redhat.com> References: <54C2A245.4010307@redhat.com> <20150129210723.GA31584@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150129210723.GA31584@redhat.com> 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 It is not clear why the "else" branch clears ->fpu_counter, this makes no sense. If use_eager_fpu() then this has no effect. Otherwise, if we actually wanted to prevent fpu preload after the context switch we would need to reset it unconditionally, even if __thread_has_fpu(). Signed-off-by: Oleg Nesterov --- arch/x86/kernel/i387.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c index 4734865..c3b92c0 100644 --- a/arch/x86/kernel/i387.c +++ b/arch/x86/kernel/i387.c @@ -122,8 +122,7 @@ void unlazy_fpu(struct task_struct *tsk) if (__thread_has_fpu(tsk)) { __save_init_fpu(tsk); __thread_fpu_end(tsk); - } else - tsk->thread.fpu_counter = 0; + } preempt_enable(); } EXPORT_SYMBOL(unlazy_fpu); -- 1.5.5.1