Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2260525imm; Thu, 18 Oct 2018 11:34:36 -0700 (PDT) X-Google-Smtp-Source: ACcGV61uv0xl0Mus8XT2dii4fZyU+bXdf4eRkCzwHHs5ZO9kz5KrBBF4bPF5X4jHox5Vcq3OrVxv X-Received: by 2002:a63:5308:: with SMTP id h8-v6mr28680864pgb.358.1539887675985; Thu, 18 Oct 2018 11:34:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539887675; cv=none; d=google.com; s=arc-20160816; b=oc7w4N/GR+4i5BTlQMlbjEMEY6cR3ejRMsKkkIHpfd7ba74cNFtk5rw3KtbCAscdsY Pjc1eYI8b6OoMZFPvxUjuPZ3mV5ZTZo3XbBKSMbZVkXKKpHlWQRyZD4zHvOPawDYFMKH nsUKC6/oI+rdXgioXXX9KZCduTglWx1F23/s8Lbm+4A5GEk6hX/R4FgWXRnPxIpYqCrq sJdauxDwBJh0dRBq01Y9lzmwFhDJEagBC8LxCPS0g9J7FBeKhLPdG7QfD+M+BimZ2nbK oOlHBKNxYB7HBW7uOgVmc0hbw7AzFYUiDjoKDcWXG/xL3n1iDMe/e5JTgXdu84hE6OZm 9krA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IFUIcLtUZf7zsXui92vb4RwHIa8QSGlI5j4ct/qzGdQ=; b=eAakVSpyM6xYsUGiC5V0vg1KIzqTg86ytPjLwKnKwFWFUF8fA+8DDeF07Q9GdY5Liz cUim3MV6UetGD37SEONXjmvD0xchgHr7ccz9xcSyHVg9Bz2gq0/9tIGCr7JuNvifYxM1 GgqHiIpKx0jsREZ/UKPI9uuFBtCHpHWlQDFvu7tyHRxoLf9AKlvbX7vjiiU3vKxFd4MD HkLchQ1UaAXQxIVawIfC6I6wYhPSuL9XDkICDVVGe5cfjjfof0cHuFFBZOWg0mccjx0w F20SS9fF/U1d1bEEiqRyHpOsbfHFVfaeNppg9PsX2VVh3b1zGnsiihC8ZGszLBlMIMP1 /ZIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SX1nDHV9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v1-v6si7731182plp.85.2018.10.18.11.34.20; Thu, 18 Oct 2018 11:34:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SX1nDHV9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730709AbeJSCJl (ORCPT + 99 others); Thu, 18 Oct 2018 22:09:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:59182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728851AbeJSCJk (ORCPT ); Thu, 18 Oct 2018 22:09:40 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C6993204FD; Thu, 18 Oct 2018 18:07:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539886052; bh=40zpIRugQuMGaAIOepOSf3UkDWwiG6pVdcCTtoSTvG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SX1nDHV9Lnz5zfaI8GVdbUFEfBntdH1zN5R9X5HeCLUr0UiR73Bx8hnxTJ5PiYpDc TRJ+DEQKaSb3QBP6H8n259er7bbKrhNFTwq/h4q/uM055D5DpmIwJWInfcVtOR/0jR rTUE9OfuNQx3/eTlWPM1jg0EDKcct1odDUBjQu5g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rik van Riel , Andy Lutomirski , Borislav Petkov , Brian Gerst , Dave Hansen , Denys Vlasenko , Fenghua Yu , "H. Peter Anvin" , Josh Poimboeuf , Linus Torvalds , Oleg Nesterov , Peter Zijlstra , Quentin Casasnovas , Thomas Gleixner , pbonzini@redhat.com, Ingo Molnar , Daniel Sangorrin Subject: [PATCH 4.4 33/48] x86/fpu: Remove struct fpu::counter Date: Thu, 18 Oct 2018 19:55:08 +0200 Message-Id: <20181018175429.718560543@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181018175427.133690306@linuxfoundation.org> References: <20181018175427.133690306@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rik van Riel commit 3913cc3507575273beb165a5e027a081913ed507 upstream. With the lazy FPU code gone, we no longer use the counter field in struct fpu for anything. Get rid it. Signed-off-by: Rik van Riel Reviewed-by: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Dave Hansen Cc: Denys Vlasenko Cc: Fenghua Yu Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Quentin Casasnovas Cc: Thomas Gleixner Cc: pbonzini@redhat.com Link: http://lkml.kernel.org/r/1475627678-20788-6-git-send-email-riel@redhat.com Signed-off-by: Ingo Molnar Signed-off-by: Daniel Sangorrin Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/fpu/internal.h | 3 --- arch/x86/include/asm/fpu/types.h | 11 ----------- arch/x86/kernel/fpu/core.c | 3 --- 3 files changed, 17 deletions(-) --- a/arch/x86/include/asm/fpu/internal.h +++ b/arch/x86/include/asm/fpu/internal.h @@ -575,15 +575,12 @@ switch_fpu_prepare(struct fpu *old_fpu, /* Don't change CR0.TS if we just switch! */ if (fpu.preload) { - new_fpu->counter++; __fpregs_activate(new_fpu); prefetch(&new_fpu->state); } } else { - old_fpu->counter = 0; old_fpu->last_cpu = -1; if (fpu.preload) { - new_fpu->counter++; if (fpu_want_lazy_restore(new_fpu, cpu)) fpu.preload = 0; else --- a/arch/x86/include/asm/fpu/types.h +++ b/arch/x86/include/asm/fpu/types.h @@ -303,17 +303,6 @@ struct fpu { unsigned char fpregs_active; /* - * @counter: - * - * This counter contains the number of consecutive context switches - * during which the FPU stays used. If this is over a threshold, the - * lazy FPU restore logic becomes eager, to save the trap overhead. - * This is an unsigned char so that after 256 iterations the counter - * wraps and the context switch behavior turns lazy again; this is to - * deal with bursty apps that only use the FPU for a short time: - */ - unsigned char counter; - /* * @state: * * In-memory copy of all FPU registers that we save/restore --- a/arch/x86/kernel/fpu/core.c +++ b/arch/x86/kernel/fpu/core.c @@ -250,7 +250,6 @@ static void fpu_copy(struct fpu *dst_fpu int fpu__copy(struct fpu *dst_fpu, struct fpu *src_fpu) { - dst_fpu->counter = 0; dst_fpu->fpregs_active = 0; dst_fpu->last_cpu = -1; @@ -353,7 +352,6 @@ void fpu__restore(struct fpu *fpu) kernel_fpu_disable(); fpregs_activate(fpu); copy_kernel_to_fpregs(&fpu->state); - fpu->counter++; kernel_fpu_enable(); } EXPORT_SYMBOL_GPL(fpu__restore); @@ -370,7 +368,6 @@ EXPORT_SYMBOL_GPL(fpu__restore); void fpu__drop(struct fpu *fpu) { preempt_disable(); - fpu->counter = 0; if (fpu->fpregs_active) { /* Ignore delayed exceptions from user space */