Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754239Ab0GaApY (ORCPT ); Fri, 30 Jul 2010 20:45:24 -0400 Received: from mga11.intel.com ([192.55.52.93]:3753 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751601Ab0GaApV (ORCPT ); Fri, 30 Jul 2010 20:45:21 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.55,290,1278313200"; d="scan'208";a="591511889" Message-Id: <20100731004316.101616883@sbsiddha-MOBL3.sc.intel.com> User-Agent: quilt/0.47-1 Date: Fri, 30 Jul 2010 17:41:24 -0700 From: Suresh Siddha To: "H. Peter Anvin" , Ingo Molnar , Thomas Gleixner Cc: LKML , Suresh Siddha , Tejun Heo , Oleg Nesterov , Andrew Morton , Tony Luck Subject: [patch v2 1/2] workqueue: mark init_workqueues() as early_initcall() Content-Disposition: inline; filename=init_workqueues_before_smp_init.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2658 Lines: 77 Mark init_workqueues() as early_initcall() and thus it will be initialized before smp bringup. init_workqueues() registers for the hotcpu notifier and thus it should cope with the processors that are brought online after the workqueues are initialized. x86, ia64 smp bringup code uses workqueues and uses a workaround for the cold boot process (as the workqueues are initialized post smp_init()). Marking init_workqueues() as early_initcall() will pave the way for cleaning up this code. Signed-off-by: Suresh Siddha --- include/linux/workqueue.h | 1 - init/main.c | 2 -- kernel/workqueue.c | 5 ++++- 3 files changed, 4 insertions(+), 4 deletions(-) Index: linux-next/init/main.c =================================================================== --- linux-next.orig/init/main.c +++ linux-next/init/main.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -787,7 +786,6 @@ static void __init do_initcalls(void) */ static void __init do_basic_setup(void) { - init_workqueues(); cpuset_init_smp(); usermodehelper_init(); init_tmpfs(); Index: linux-next/include/linux/workqueue.h =================================================================== --- linux-next.orig/include/linux/workqueue.h +++ linux-next/include/linux/workqueue.h @@ -327,7 +327,6 @@ extern int schedule_delayed_work_on(int extern int schedule_on_each_cpu(work_func_t func); extern int keventd_up(void); -extern void init_workqueues(void); int execute_in_process_context(work_func_t fn, struct execute_work *); extern int flush_work(struct work_struct *work); Index: linux-next/kernel/workqueue.c =================================================================== --- linux-next.orig/kernel/workqueue.c +++ linux-next/kernel/workqueue.c @@ -3509,7 +3509,7 @@ out_unlock: } #endif /* CONFIG_FREEZER */ -void __init init_workqueues(void) +static int __init init_workqueues(void) { unsigned int cpu; int i; @@ -3561,4 +3561,7 @@ void __init init_workqueues(void) system_unbound_wq = alloc_workqueue("events_unbound", WQ_UNBOUND, WQ_UNBOUND_MAX_ACTIVE); BUG_ON(!system_wq || !system_long_wq || !system_nrt_wq); + + return 0; } +early_initcall(init_workqueues); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/