From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932423AbbCMS3I (ORCPT ); Fri, 13 Mar 2015 14:29:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49428 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932277AbbCMS3F (ORCPT ); Fri, 13 Mar 2015 14:29:05 -0400 Date: Fri, 13 Mar 2015 19:26:56 +0100 From: Oleg Nesterov To: Dave Hansen , Borislav Petkov , Ingo Molnar Cc: Andy Lutomirski , Linus Torvalds , Pekka Riikonen , Rik van Riel , Suresh Siddha , LKML , "Yu, Fenghua" , Quentin Casasnovas Subject: [PATCH 0/1] x86/cpu: don't allocate fpu->state for swapper/0 Message-ID: <20150313182656.GA8249@redhat.com> References: <54F74F59.5070107@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54F74F59.5070107@intel.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 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(); } /*