[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150313182656.GA8249@redhat.com>
Date: Fri, 13 Mar 2015 19:26:56 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Dave Hansen <dave.hansen@...el.com>, Borislav Petkov <bp@...e.de>,
Ingo Molnar <mingo@...nel.org>
Cc: Andy Lutomirski <luto@...capital.net>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Pekka Riikonen <priikone@....fi>,
Rik van Riel <riel@...hat.com>,
Suresh Siddha <sbsiddha@...il.com>,
LKML <linux-kernel@...r.kernel.org>,
"Yu, Fenghua" <fenghua.yu@...el.com>,
Quentin Casasnovas <quentin.casasnovas@...cle.com>
Subject: [PATCH 0/1] x86/cpu: don't allocate fpu->state for swapper/0
Hello.
This patch is "out of order" a bit, but since Borislav mentioned this
during review...
And I was going to send the 2nd one (below), but it turns out that
__init_refok is not discarded? So is there any way to do
void __init init_function();
void non_init_func()
{
if (can_only_be_true_before_free_initmem)
init_function();
}
and avoid the warning?
Fenghua, could you please explain the SYSTEM_BOOTING check in __save_fpu?
It was added by f41d830fa8900 "x86/xsaves: Save xstate to task's xsave area
in __save_fpu during booting time", the changelog says:
__save_fpu() can be called during early booting time
how? from where? Do we expect math_error()->unlazy_fpu() at boot time, or what?
Oleg.
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -532,7 +532,7 @@ void setup_xstate_comp(void)
/*
* setup the xstate image representing the init state
*/
-static void __init setup_init_fpu_buf(void)
+static noinline void __init_refok setup_init_fpu_buf(void)
{
/*
* Setup init_xstate_buf to represent the init state of
@@ -677,16 +677,8 @@ void xsave_init(void)
this_func();
}
-static inline void __init eager_fpu_init_bp(void)
-{
- if (!init_xstate_buf)
- setup_init_fpu_buf();
-}
-
void eager_fpu_init(void)
{
- static __refdata void (*boot_func)(void) = eager_fpu_init_bp;
-
WARN_ON(used_math());
current_thread_info()->status = 0;
@@ -698,10 +690,8 @@ void eager_fpu_init(void)
return;
}
- if (boot_func) {
- boot_func();
- boot_func = NULL;
- }
+ if (!init_xstate_buf)
+ setup_init_fpu_buf();
}
/*
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists