public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* workqueue deadlock
@ 2006-12-07  0:26 Bjorn Helgaas
  2006-12-07  6:17 ` Srivatsa Vaddagiri
  2006-12-07 18:51 ` Andrew Morton
  0 siblings, 2 replies; 23+ messages in thread
From: Bjorn Helgaas @ 2006-12-07  0:26 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel; +Cc: Myron Stowe, Jens Axboe

I'm seeing a workqueue-related deadlock.  This is on an ia64
box running SLES10, but it looks like the same problem should
be possible in current upstream on any architecture.

Here are the two tasks involved:

  events/4:
    schedule
    __down
    __lock_cpu_hotplug
    lock_cpu_hotplug
    flush_workqueue
    kblockd_flush
    blk_sync_queue
    cfq_shutdown_timer_wq
    cfq_exit_queue
    elevator_exit
    blk_cleanup_queue
    scsi_free_queue
    scsi_device_dev_release_usercontext
    run_workqueue

  loadkeys:
    schedule
    flush_cpu_workqueue
    flush_workqueue
    flush_scheduled_work
    release_dev
    tty_release

loadkeys is holding the cpu_hotplug lock (acquired in flush_workqueue())
and waiting in flush_cpu_workqueue() until the cpu_workqueue drains.

But events/4 is responsible for draining it, and it is blocked waiting
to acquire the cpu_hotplug lock.

In current upstream, the cpu_hotplug lock has been replaced with
workqueue_mutex, but it looks to me like the same deadlock is still
possible.

Is there some rule that workqueue functions shouldn't try to
flush a workqueue?  Or should flush_workqueue() be smarter by
releasing the workqueue_mutex once in a while?

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2006-12-11 16:31 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-07  0:26 workqueue deadlock Bjorn Helgaas
2006-12-07  6:17 ` Srivatsa Vaddagiri
2006-12-07  6:45   ` Srivatsa Vaddagiri
2006-12-07 18:51 ` Andrew Morton
2006-12-07 19:37   ` Andrew Morton
2006-12-08  2:53     ` Srivatsa Vaddagiri
2006-12-08  4:54       ` Andrew Morton
2006-12-08  7:58         ` Srivatsa Vaddagiri
2006-12-09 10:26         ` Ingo Molnar
2006-12-09 19:47           ` Andrew Morton
2006-12-10  8:26             ` Ingo Molnar
2006-12-10  8:43               ` Andrew Morton
2006-12-10 11:49                 ` Ingo Molnar
2006-12-10 12:16                   ` Andrew Morton
2006-12-10 12:19                     ` Ingo Molnar
2006-12-10 12:34                       ` Andrew Morton
2006-12-11  6:09                         ` Ingo Molnar
2006-12-10 14:18                     ` Rafael J. Wysocki
2006-12-11  6:52                       ` Dipankar Sarma
2006-12-11 16:34                         ` Rafael J. Wysocki
2006-12-11  5:45                     ` Srivatsa Vaddagiri
2006-12-11  6:03                       ` Andrew Morton
2006-12-11  4:58               ` Srivatsa Vaddagiri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox