1. 24 Dec, 2010 26 commits
    • Tejun Heo's avatar
      ioc4: use static work_struct for ioc4_load_modules() · 883624a0
      Tejun Heo authored
      There is no reason to dynamically allocate work_struct for
      ioc4_load_modules().  It makes the code more complex and makes it
      impossible to flush the work directly.  Use static work
      ioc4_load_modules_work instead and flush it directly on exit.
      
      This removes the use of flush_scheduled_work() which is being
      deprecated.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Brent Casavant <bcasavan@sgi.com>
      883624a0
    • Tejun Heo's avatar
      init: don't call flush_scheduled_work() from do_initcalls() · ee4569a3
      Tejun Heo authored
      The call to flush_scheduled_work() in do_initcalls() is there to make
      sure all works queued to system_wq by initcalls finish before the init
      sections are dropped.
      
      However, the call doesn't make much sense at this point - there
      already are multiple different workqueues and different subsystems are
      free to create and use their own.  Ordering requirements are and
      should be expressed explicitly.
      
      Drop the call to prepare for the deprecation and removal of
      flush_scheduled_work().
      
      Andrew suggested adding sanity check where the workqueue code checks
      whether any pending or running work has the work function in the init
      text section.  However, checking this for running works requires the
      worker to keep track of the current function being executed, and
      checking only the pending works will miss most cases.  As a violation
      will almost always be caught by the usual page fault mechanism, I
      don't think it would be worthwhile to make the workqueue code track
      extra state just for this.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      ee4569a3
    • Tejun Heo's avatar
      s390: don't use flush_scheduled_work() · 6dca467a
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      
      * tape_3590: Create and use tape_3590_wq instead of the system_wq.
      
      * tape_block: Directly flush requeue_task on cleanup instead of using
        flush_scheduled_work().
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: linux390@de.ibm.com
      Cc: linux-s390@vger.kernel.org
      6dca467a
    • Tejun Heo's avatar
      rtc: don't use flush_scheduled_work() · 9db8995b
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.  On
      removal, directly cancel the work, and flush the uie_task in
      rtc-dev.c::clear_uie().
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: rtc-linux@googlegroups.com
      9db8995b
    • Tejun Heo's avatar
      mmc: update workqueue usages · 0d9ee5b2
      Tejun Heo authored
      Workqueue creation API has been updated and flush_scheduled_work() is
      deprecated and scheduled to be removed.
      
      * core/core.c: Use alloc_ordered_workqueue() instead of
        create_singlethread_workqueue().  This removes an unnecessary
        rescuer.
      
      * host/omap.c: Create, use and flush mmc_omap_wq instead of the
        system_wq.
      
      * Flush host->mmc_carddetect_work directly on removal instead of using
        flush_scheduled_work().
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Chris Ball <cjb@laptop.org>
      Cc: linux-mmc@vger.kernel.org
      0d9ee5b2
    • Tejun Heo's avatar
      mfd: update workqueue usages · afdb32f2
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      
      * In menelaus, flush menelaus->work directly on probe failure.  Also,
        make sure the work isn't running on removal.
      
      * In tps65010, cancel_delayed_work() + flush_scheduled_work() ->
        cancel_delayed_work_sync().  While at it, remove unnecessary (void)
        casts on return value, and use schedule_delayed_work() and
        to_delayed_work() instead of using delayed_work's internal work
        field.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Samuel Ortiz <sameo@linux.intel.com>
      afdb32f2
    • Tejun Heo's avatar
      dvb: don't use flush_scheduled_work() · 0d9c76ae
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      
      * Flush the used works directly.
      
      * Replace the deprecated cancel_rearming_delayed_work() +
        flush_scheduled_work() -> cancel_delayed_work_sync().
      
      * Make sure mantis->uart_work isn't running on exit.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
      Cc: linux-media@vger.kernel.org
      0d9c76ae
    • Tejun Heo's avatar
      leds-wm8350: don't use flush_scheduled_work() · 99ef2121
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush led->work on removal instead.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      99ef2121
    • Tejun Heo's avatar
      mISDN: don't use flush_scheduled_work() · 0d26aa70
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush ch->workq when freeing channel and cancel it on
      release.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Karsten Keil <isdn@linux-pingi.de>
      Cc: netdev@vger.kernel.org
      0d26aa70
    • Tejun Heo's avatar
      macintosh/ams: don't use flush_scheduled_work() · d9c612eb
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush ams_info.worker on detach instead.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      d9c612eb
    • Tejun Heo's avatar
      vmwgfx: don't use flush_scheduled_work() · a6665944
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush info->deferred_work on removal instead.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Thomas Hellstrom <thellstrom@vmware.com>
      a6665944
    • Tejun Heo's avatar
      tpm: don't use flush_scheduled_work() · 2e5c44c9
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush chip->work instead.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Debora Velarde <debora@linux.vnet.ibm.com>
      Cc: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
      2e5c44c9
    • Tejun Heo's avatar
      sonypi: don't use flush_scheduled_work() · 3514870f
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush sonypi_device.input_work on removal instead.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Mattia Dongili <malattia@linux.it>
      3514870f
    • Tejun Heo's avatar
      hvsi: don't use flush_scheduled_work() · 42565999
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly cancel hp->writer and flush hp->handshaker instead.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      42565999
    • Tejun Heo's avatar
      xen: don't use flush_scheduled_work() · 30d65030
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush info->work instead.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      30d65030
    • Tejun Heo's avatar
      gdrom: don't use flush_scheduled_work() · 0ead5c86
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush work on removal instead.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      0ead5c86
    • Tejun Heo's avatar
      floppy: don't use flush_scheduled_work() · 8aa0f413
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush floppy_work instead.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      8aa0f413
    • Tejun Heo's avatar
      sh: don't use flush_scheduled_work() · 539253f6
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush psw->work on removal instead.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: linux-sh@vger.kernel.org
      539253f6
    • Tejun Heo's avatar
      arm/sharpsl: don't use flush_scheduled_work() · fe413ec3
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush toggle_charger and sharpsl_bat works on suspend
      instead.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      fe413ec3
    • Tejun Heo's avatar
      ncpfs: don't use flush_scheduled_work() · 5d8e4bdd
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush the used works on stop instead.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Petr Vandrovec <petr@vandrovec.name>
      5d8e4bdd
    • Tejun Heo's avatar
      drm/ttm: use cancel_delayed_work_sync() in ttm_bo · f094cfc6
      Tejun Heo authored
      Make ttm_bo::ttm_bo_device_release call cancel_delayed_work_sync()
      instead of calling cancel_delayed_work() followed by
      flush_scheduled_work().
      
      This is to prepare for the deprecation and removal of
      flush_scheduled_work().
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc:: Thomas Hellstrom <thellstrom@vmware.com>
      Cc:: Dave Airlie <airlied@redhat.com>
      f094cfc6
    • Tejun Heo's avatar
      pcmcia/ipwireless: don't use flush_scheduled_work() · 404437ef
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush the used works instead.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarJiri Kosina <jkosina@suse.cz>
      Acked-by: default avatarDavid Sterba <dsterba@suse.cz>
      404437ef
    • Tejun Heo's avatar
      ocfs2: don't use flush_scheduled_work() · 9b00a818
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      
      * cancel_delayed_work() + flush_schedule_work() ->
        cancel_delayed_work_sync().
      
      * flush qs->qs_work directly on exit instead.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarJoel Becker <joel.becker@oracle.com>
      Cc: Mark Fasheh <mfasheh@suse.com>
      9b00a818
    • Tejun Heo's avatar
      net/dsa: don't use flush_scheduled_work() · 7f6b0db9
      Tejun Heo authored
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush dst->link_poll_work on remove instead.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarLennert Buytenhek <buytenh@wantstofly.org>
      7f6b0db9
    • Tejun Heo's avatar
      isdn/capi: make kcapi use a separate workqueue · 158fa677
      Tejun Heo authored
      flush_scheduled_work() is deprecated and will be removed.  Because
      kcapi uses fire-and-forget type works, it's impossible to flush each
      work explicitly.  Create and use a dedicated workqueue instead.
      
      Please note that with recent workqueue changes, each workqueue doesn't
      reserve a lot of resources and using it as a flush domain is fine.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarJan Kiszka <jan.kiszka@web.de>
      158fa677
    • Tejun Heo's avatar
      isdn/capi: unregister capictr notifier after init failure · 7fa5e85a
      Tejun Heo authored
      capidrv_init() could leave capictr notifier dangling after init
      failure.  Fix it.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarJan Kiszka <jan.kiszka@web.de>
      7fa5e85a
  2. 20 Dec, 2010 1 commit
    • Tejun Heo's avatar
      workqueue: allow chained queueing during destruction · c8efcc25
      Tejun Heo authored
      Currently, destroy_workqueue() makes the workqueue deny all new
      queueing by setting WQ_DYING and flushes the workqueue once before
      proceeding with destruction; however, there are cases where work items
      queue more related work items.  Currently, such users need to
      explicitly flush the workqueue multiple times depending on the
      possible depth of such chained queueing.
      
      This patch updates the queueing path such that a work item can queue
      further work items on the same workqueue even when WQ_DYING is set.
      The flush on destruction is automatically retried until the workqueue
      is empty.  This guarantees that the workqueue is empty on destruction
      while allowing chained queueing.
      
      The flush retry logic whines if it takes too many retries to drain the
      workqueue.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      c8efcc25
  3. 15 Dec, 2010 2 commits
  4. 14 Dec, 2010 2 commits
    • Steven Rostedt's avatar
      workqueue: It is likely that WORKER_NOT_RUNNING is true · 2d64672e
      Steven Rostedt authored
      Running the annotate branch profiler on three boxes, including my
      main box that runs firefox, evolution, xchat, and is part of the distcc farm,
      showed this with the likelys in the workqueue code:
      
       correct incorrect  %        Function                  File              Line
       ------- ---------  -        --------                  ----              ----
            96   996253  99 wq_worker_sleeping             workqueue.c          703
            96   996247  99 wq_worker_waking_up            workqueue.c          677
      
      The likely()s in this case were assuming that WORKER_NOT_RUNNING will
      most likely be false. But this is not the case. The reason is
      (and shown by adding trace_printks and testing it) that most of the time
      WORKER_PREP is set.
      
      In worker_thread() we have:
      
      	worker_clr_flags(worker, WORKER_PREP);
      
      	[ do work stuff ]
      
      	worker_set_flags(worker, WORKER_PREP, false);
      
      (that 'false' means not to wake up an idle worker)
      
      The wq_worker_sleeping() is called from schedule when a worker thread
      is putting itself to sleep. Which happens most of the time outside
      of that [ do work stuff ].
      
      The wq_worker_waking_up is called by the wakeup worker code, which
      is also callod outside that [ do work stuff ].
      
      Thus, the likely and unlikely used by those two functions are actually
      backwards.
      
      Remove the annotation and let gcc figure it out.
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      2d64672e
    • Tejun Heo's avatar
      MAINTAINERS: Add workqueue entry · 3e6cd7a4
      Tejun Heo authored
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      3e6cd7a4
  5. 26 Nov, 2010 1 commit
  6. 24 Nov, 2010 8 commits