All of lore.kernel.org
 help / color / mirror / Atom feed
From: riel@redhat.com
To: oleg@redhat.com
Cc: dave.hansen@linux.intel.com, sbsiddha@gmail.com,
	luto@amacapital.net, tglx@linutronix.de, mingo@kernel.org,
	hpa@zytor.com, fenghua.yu@intel.com, x86@kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/8] x86,fpu: move lazy restore functions up a few lines
Date: Fri,  6 Feb 2015 15:02:01 -0500	[thread overview]
Message-ID: <1423252925-14451-5-git-send-email-riel@redhat.com> (raw)
In-Reply-To: <1423252925-14451-1-git-send-email-riel@redhat.com>

From: Rik van Riel <riel@redhat.com>

We need another lazy restore related function, that will be called
from a function that is above where the lazy restore functions are
now. It would be nice to keep all three functions grouped together.

Signed-off-by: Rik van Riel <riel@redhat.com>
---
 arch/x86/include/asm/fpu-internal.h | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/arch/x86/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h
index 27d00e04f911..439ac3921a1e 100644
--- a/arch/x86/include/asm/fpu-internal.h
+++ b/arch/x86/include/asm/fpu-internal.h
@@ -67,6 +67,24 @@ extern void finit_soft_fpu(struct i387_soft_struct *soft);
 static inline void finit_soft_fpu(struct i387_soft_struct *soft) {}
 #endif
 
+/*
+ * Must be run with preemption disabled: this clears the fpu_owner_task,
+ * on this CPU.
+ *
+ * This will disable any lazy FPU state restore of the current FPU state,
+ * but if the current thread owns the FPU, it will still be saved by.
+ */
+static inline void __cpu_disable_lazy_restore(unsigned int cpu)
+{
+	per_cpu(fpu_owner_task, cpu) = NULL;
+}
+
+static inline int fpu_lazy_restore(struct task_struct *new, unsigned int cpu)
+{
+	return new == this_cpu_read_stable(fpu_owner_task) &&
+		cpu == new->thread.fpu.last_cpu;
+}
+
 static inline int is_ia32_compat_frame(void)
 {
 	return config_enabled(CONFIG_IA32_EMULATION) &&
@@ -400,24 +418,6 @@ static inline void drop_init_fpu(struct task_struct *tsk)
  */
 typedef struct { int preload; } fpu_switch_t;
 
-/*
- * Must be run with preemption disabled: this clears the fpu_owner_task,
- * on this CPU.
- *
- * This will disable any lazy FPU state restore of the current FPU state,
- * but if the current thread owns the FPU, it will still be saved by.
- */
-static inline void __cpu_disable_lazy_restore(unsigned int cpu)
-{
-	per_cpu(fpu_owner_task, cpu) = NULL;
-}
-
-static inline int fpu_lazy_restore(struct task_struct *new, unsigned int cpu)
-{
-	return new == this_cpu_read_stable(fpu_owner_task) &&
-		cpu == new->thread.fpu.last_cpu;
-}
-
 static inline fpu_switch_t switch_fpu_prepare(struct task_struct *old, struct task_struct *new, int cpu)
 {
 	fpu_switch_t fpu;
-- 
1.9.3


  parent reply	other threads:[~2015-02-06 20:03 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-06 20:01 [PATCH 0/8] x86,fpu: various small FPU cleanups and optimizations riel
2015-02-06 20:01 ` [PATCH 1/8] x86, fpu: unlazy_fpu: don't reset thread.fpu_counter riel
2015-02-16 17:04   ` Borislav Petkov
2015-02-16 17:58     ` Rik van Riel
2015-02-16 18:14       ` Oleg Nesterov
2015-02-16 18:16         ` Borislav Petkov
2015-02-19 11:32   ` [tip:x86/fpu] x86/fpu: Don't " tip-bot for Oleg Nesterov
2015-02-06 20:01 ` [PATCH 2/8] x86, fpu: unlazy_fpu: don't do __thread_fpu_end() if use_eager_fpu() riel
2015-02-16 20:25   ` Borislav Petkov
2015-02-17 10:47     ` Oleg Nesterov
2015-02-17 12:09       ` Borislav Petkov
2015-02-19 11:32   ` [tip:x86/fpu] x86/fpu: Don't " tip-bot for Oleg Nesterov
2015-02-06 20:02 ` [PATCH 3/8] x86, fpu: kill save_init_fpu(), change math_error() to use unlazy_fpu() riel
2015-02-16 21:09   ` Borislav Petkov
2015-02-16 21:30     ` Rik van Riel
2015-02-17 10:58       ` Oleg Nesterov
2015-02-19 11:32   ` [tip:x86/fpu] x86/fpu: Change math_error() to use unlazy_fpu(), kill (now) unused save_init_fpu() tip-bot for Oleg Nesterov
2015-02-06 20:02 ` riel [this message]
2015-02-19 11:33   ` [tip:x86/fpu] x86/fpu: Move lazy restore functions up a few lines tip-bot for Rik van Riel
2015-02-06 20:02 ` [PATCH 5/8] x86,fpu: introduce task_disable_lazy_fpu_restore helper riel
2015-02-19 11:33   ` [tip:x86/fpu] x86/fpu: Introduce task_disable_lazy_fpu_restore() helper tip-bot for Rik van Riel
2015-02-06 20:02 ` [PATCH 6/8] x86,fpu: use an explicit if/else in switch_fpu_prepare riel
2015-02-17  8:44   ` Borislav Petkov
2015-02-19 11:33   ` [tip:x86/fpu] x86/fpu: Use an explicit if/ else in switch_fpu_prepare() tip-bot for Rik van Riel
2015-02-06 20:02 ` [PATCH 7/8] x86,fpu: use disable_task_lazy_fpu_restore helper riel
2015-02-17  9:00   ` Borislav Petkov
2015-02-17 11:04     ` Oleg Nesterov
2015-02-17 12:11       ` Borislav Petkov
2015-02-19 11:34   ` [tip:x86/fpu] x86/fpu: Use task_disable_lazy_fpu_restore() helper tip-bot for Rik van Riel
2015-02-06 20:02 ` [PATCH 8/8] x86,fpu: also check fpu_lazy_restore when use_eager_fpu riel
2015-02-19 11:34   ` [tip:x86/fpu] x86/fpu: Also check fpu_lazy_restore() when use_eager_fpu() tip-bot for Rik van Riel
2015-02-16 15:26 ` [PATCH 0/8] x86,fpu: various small FPU cleanups and optimizations Rik van Riel
2015-02-16 16:00   ` Borislav Petkov

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=1423252925-14451-5-git-send-email-riel@redhat.com \
    --to=riel@redhat.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=sbsiddha@gmail.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.