Skip to content

Commit

Permalink
init,cpuset: fix initialize order
Browse files Browse the repository at this point in the history
Impact: cpuset_wq should be initialized after init_workqueues()

When I read /debugfs/tracing/trace_stat/workqueues,
I got this:

 # CPU  INSERTED  EXECUTED   NAME
 # |      |         |          |

   0      0          0       cpuset
   0    285        285       events/0
   0      2          2       work_on_cpu/0
   0   1115       1115       khelper
   0    325        325       kblockd/0
   0      0          0       kacpid
   0      0          0       kacpi_notify
   0      0          0       ata/0
   0      0          0       ata_aux
   0      0          0       ksuspend_usbd
   0      0          0       aio/0
   0      0          0       nfsiod
   0      0          0       kpsmoused
   0      0          0       kstriped
   0      0          0       kondemand/0
   0      1          1       hid_compat
   0      0          0       rpciod/0

   1     64         64       events/1
   1      2          2       work_on_cpu/1
   1      5          5       kblockd/1
   1      0          0       ata/1
   1      0          0       aio/1
   1      0          0       kondemand/1
   1      0          0       rpciod/1

I found "cpuset" is at the earliest.

I found a create_singlethread_workqueue() is earlier than
init_workqueues():

kernel_init()
->cpuset_init_smp()
  ->create_singlethread_workqueue()
->do_basic_setup()
  ->init_workqueues()

I think it's better that create_singlethread_workqueue() is called
after workqueue subsystem has been initialized.

Signed-off-by: Lai Jiangshan <[email protected]>
Acked-by: Steven Rostedt <[email protected]>
Acked-by: Frederic Weisbecker <[email protected]>
Cc: Paul Menage <[email protected]>
Cc: miaoxie <[email protected]>
Cc: Li Zefan <[email protected]>
Cc: Andrew Morton <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Lai Jiangshan authored and Ingo Molnar committed Mar 25, 2009
1 parent 2f63b84 commit 759ee09
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ static void __init do_basic_setup(void)
{
rcu_init_sched(); /* needed by module_init stage. */
init_workqueues();
cpuset_init_smp();
usermodehelper_init();
driver_init();
init_irq_proc();
Expand Down Expand Up @@ -865,8 +866,6 @@ static int __init kernel_init(void * unused)
smp_init();
sched_init_smp();

cpuset_init_smp();

do_basic_setup();

/*
Expand Down

0 comments on commit 759ee09

Please sign in to comment.