From: riel@redhat.com
To: linux-kernel@vger.kernel.org
Cc: dave.hansen@linux.intel.com, x86@kernel.org, tglx@linutronix.de,
pbonzini@redhat.com, mingo@redhat.com, luto@kernel.org,
pa@zytor.com, bp@suse.de
Subject: [PATCH 5/9] x86/fpu: remove fpu.counter
Date: Tue, 4 Oct 2016 20:34:34 -0400 [thread overview]
Message-ID: <1475627678-20788-6-git-send-email-riel@redhat.com> (raw)
In-Reply-To: <1475627678-20788-1-git-send-email-riel@redhat.com>
From: Rik van Riel <riel@redhat.com>
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 <riel@redhat.com>
---
arch/x86/include/asm/fpu/internal.h | 3 ---
arch/x86/include/asm/fpu/types.h | 11 -----------
arch/x86/include/asm/trace/fpu.h | 5 +----
arch/x86/kernel/fpu/core.c | 3 ---
4 files changed, 1 insertion(+), 21 deletions(-)
diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h
index 7801d32347a2..499d6ed0e376 100644
--- a/arch/x86/include/asm/fpu/internal.h
+++ b/arch/x86/include/asm/fpu/internal.h
@@ -581,16 +581,13 @@ switch_fpu_prepare(struct fpu *old_fpu, struct fpu *new_fpu, int cpu)
/* Don't change CR0.TS if we just switch! */
if (fpu.preload) {
- new_fpu->counter++;
__fpregs_activate(new_fpu);
trace_x86_fpu_regs_activated(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
diff --git a/arch/x86/include/asm/fpu/types.h b/arch/x86/include/asm/fpu/types.h
index 48df486b02f9..e31332d6f0e8 100644
--- a/arch/x86/include/asm/fpu/types.h
+++ b/arch/x86/include/asm/fpu/types.h
@@ -322,17 +322,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
diff --git a/arch/x86/include/asm/trace/fpu.h b/arch/x86/include/asm/trace/fpu.h
index 9217ab1f5bf6..342e59789fcd 100644
--- a/arch/x86/include/asm/trace/fpu.h
+++ b/arch/x86/include/asm/trace/fpu.h
@@ -14,7 +14,6 @@ DECLARE_EVENT_CLASS(x86_fpu,
__field(struct fpu *, fpu)
__field(bool, fpregs_active)
__field(bool, fpstate_active)
- __field(int, counter)
__field(u64, xfeatures)
__field(u64, xcomp_bv)
),
@@ -23,17 +22,15 @@ DECLARE_EVENT_CLASS(x86_fpu,
__entry->fpu = fpu;
__entry->fpregs_active = fpu->fpregs_active;
__entry->fpstate_active = fpu->fpstate_active;
- __entry->counter = fpu->counter;
if (boot_cpu_has(X86_FEATURE_OSXSAVE)) {
__entry->xfeatures = fpu->state.xsave.header.xfeatures;
__entry->xcomp_bv = fpu->state.xsave.header.xcomp_bv;
}
),
- TP_printk("x86/fpu: %p fpregs_active: %d fpstate_active: %d counter: %d xfeatures: %llx xcomp_bv: %llx",
+ TP_printk("x86/fpu: %p fpregs_active: %d fpstate_active: %d xfeatures: %llx xcomp_bv: %llx",
__entry->fpu,
__entry->fpregs_active,
__entry->fpstate_active,
- __entry->counter,
__entry->xfeatures,
__entry->xcomp_bv
)
diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
index 036e14fe3b77..6a37d525bdbe 100644
--- a/arch/x86/kernel/fpu/core.c
+++ b/arch/x86/kernel/fpu/core.c
@@ -222,7 +222,6 @@ EXPORT_SYMBOL_GPL(fpstate_init);
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;
@@ -430,7 +429,6 @@ void fpu__restore(struct fpu *fpu)
trace_x86_fpu_before_restore(fpu);
fpregs_activate(fpu);
copy_kernel_to_fpregs(&fpu->state);
- fpu->counter++;
trace_x86_fpu_after_restore(fpu);
kernel_fpu_enable();
}
@@ -448,7 +446,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 */
--
2.7.4
next prev parent reply other threads:[~2016-10-05 0:35 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-05 0:34 [PATCH 0/9] x86/fpu: remove lazy FPU mode & various FPU cleanups riel
2016-10-05 0:34 ` [PATCH 1/9] x86/crypto: Remove X86_FEATURE_EAGER_FPU ifdef from the crc32c code riel
2016-10-05 0:40 ` Rik van Riel
2016-10-07 9:43 ` [tip:x86/fpu] x86/crypto, x86/fpu: Remove X86_FEATURE_EAGER_FPU #ifdef " tip-bot for Andy Lutomirski
2016-10-05 0:34 ` [PATCH 2/9] x86/fpu: Hard-disable lazy fpu mode riel
2016-10-05 7:14 ` Paolo Bonzini
2016-10-05 13:57 ` Rik van Riel
2016-10-05 14:03 ` Paolo Bonzini
2016-10-05 15:59 ` Andy Lutomirski
2016-10-05 16:09 ` Paolo Bonzini
2016-10-07 9:43 ` [tip:x86/fpu] x86/fpu: Hard-disable lazy FPU mode tip-bot for Andy Lutomirski
2016-10-05 0:34 ` [PATCH 3/9] x86/fpu: Remove the XFEATURE_MASK_EAGER/LAZY distinction riel
2016-10-07 9:44 ` [tip:x86/fpu] " tip-bot for Andy Lutomirski
2016-10-05 0:34 ` [PATCH 4/9] x86/fpu: Remove use_eager_fpu() riel
2016-10-07 9:44 ` [tip:x86/fpu] " tip-bot for Andy Lutomirski
2016-10-05 0:34 ` riel [this message]
2016-10-05 2:07 ` [PATCH 5/9] x86/fpu: remove fpu.counter Andy Lutomirski
2016-10-07 9:45 ` [tip:x86/fpu] x86/fpu: Remove struct fpu::counter tip-bot for Rik van Riel
2016-10-05 0:34 ` [PATCH 6/9] x86/fpu,kvm: remove kvm vcpu->fpu_counter riel
2016-10-07 9:45 ` [tip:x86/fpu] x86/fpu, kvm: Remove KVM vcpu->fpu_counter tip-bot for Rik van Riel
2016-10-05 0:34 ` [PATCH 7/9] x86/fpu: rename lazy restore functions to "register state valid" riel
2016-10-05 2:09 ` Andy Lutomirski
2016-10-07 9:46 ` [tip:x86/fpu] x86/fpu: Rename " tip-bot for Rik van Riel
2016-10-05 0:34 ` [PATCH 8/9] x86/fpu: remove __fpregs_(de)activate riel
2016-10-05 2:10 ` Andy Lutomirski
2016-10-07 9:46 ` [tip:x86/fpu] x86/fpu: Remove __fpregs_(de)activate() tip-bot for Rik van Riel
2016-10-05 0:34 ` [PATCH 9/9] x86/fpu: split old & new fpu code paths riel
2016-10-07 9:47 ` [tip:x86/fpu] x86/fpu: Split old & new FPU " tip-bot for Rik van Riel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1475627678-20788-6-git-send-email-riel@redhat.com \
--to=riel@redhat.com \
--cc=bp@suse.de \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=pa@zytor.com \
--cc=pbonzini@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.