1. 24 12月, 2010 25 次提交
    • T
      init: don't call flush_scheduled_work() from do_initcalls() · ee4569a3
      Tejun Heo 提交于
      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: NTejun Heo <tj@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      ee4569a3
    • T
      s390: don't use flush_scheduled_work() · 6dca467a
      Tejun Heo 提交于
      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: NTejun 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
    • T
      rtc: don't use flush_scheduled_work() · 9db8995b
      Tejun Heo 提交于
      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: NTejun Heo <tj@kernel.org>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: rtc-linux@googlegroups.com
      9db8995b
    • T
      mmc: update workqueue usages · 0d9ee5b2
      Tejun Heo 提交于
      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: NTejun Heo <tj@kernel.org>
      Cc: Chris Ball <cjb@laptop.org>
      Cc: linux-mmc@vger.kernel.org
      0d9ee5b2
    • T
      mfd: update workqueue usages · afdb32f2
      Tejun Heo 提交于
      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: NTejun Heo <tj@kernel.org>
      Cc: Samuel Ortiz <sameo@linux.intel.com>
      afdb32f2
    • T
      dvb: don't use flush_scheduled_work() · 0d9c76ae
      Tejun Heo 提交于
      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: NTejun Heo <tj@kernel.org>
      Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
      Cc: linux-media@vger.kernel.org
      0d9c76ae
    • T
      leds-wm8350: don't use flush_scheduled_work() · 99ef2121
      Tejun Heo 提交于
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush led->work on removal instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      99ef2121
    • T
      mISDN: don't use flush_scheduled_work() · 0d26aa70
      Tejun Heo 提交于
      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: NTejun Heo <tj@kernel.org>
      Cc: Karsten Keil <isdn@linux-pingi.de>
      Cc: netdev@vger.kernel.org
      0d26aa70
    • T
      macintosh/ams: don't use flush_scheduled_work() · d9c612eb
      Tejun Heo 提交于
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush ams_info.worker on detach instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      d9c612eb
    • T
      vmwgfx: don't use flush_scheduled_work() · a6665944
      Tejun Heo 提交于
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush info->deferred_work on removal instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Thomas Hellstrom <thellstrom@vmware.com>
      a6665944
    • T
      tpm: don't use flush_scheduled_work() · 2e5c44c9
      Tejun Heo 提交于
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush chip->work instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Debora Velarde <debora@linux.vnet.ibm.com>
      Cc: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
      2e5c44c9
    • T
      sonypi: don't use flush_scheduled_work() · 3514870f
      Tejun Heo 提交于
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush sonypi_device.input_work on removal instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Mattia Dongili <malattia@linux.it>
      3514870f
    • T
      hvsi: don't use flush_scheduled_work() · 42565999
      Tejun Heo 提交于
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly cancel hp->writer and flush hp->handshaker instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      42565999
    • T
      xen: don't use flush_scheduled_work() · 30d65030
      Tejun Heo 提交于
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush info->work instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      30d65030
    • T
      gdrom: don't use flush_scheduled_work() · 0ead5c86
      Tejun Heo 提交于
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush work on removal instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      0ead5c86
    • T
      floppy: don't use flush_scheduled_work() · 8aa0f413
      Tejun Heo 提交于
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush floppy_work instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      8aa0f413
    • T
      sh: don't use flush_scheduled_work() · 539253f6
      Tejun Heo 提交于
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush psw->work on removal instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: linux-sh@vger.kernel.org
      539253f6
    • T
      arm/sharpsl: don't use flush_scheduled_work() · fe413ec3
      Tejun Heo 提交于
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush toggle_charger and sharpsl_bat works on suspend
      instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      fe413ec3
    • T
      ncpfs: don't use flush_scheduled_work() · 5d8e4bdd
      Tejun Heo 提交于
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush the used works on stop instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Petr Vandrovec <petr@vandrovec.name>
      5d8e4bdd
    • T
      drm/ttm: use cancel_delayed_work_sync() in ttm_bo · f094cfc6
      Tejun Heo 提交于
      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: NTejun Heo <tj@kernel.org>
      Cc:: Thomas Hellstrom <thellstrom@vmware.com>
      Cc:: Dave Airlie <airlied@redhat.com>
      f094cfc6
    • T
      pcmcia/ipwireless: don't use flush_scheduled_work() · 404437ef
      Tejun Heo 提交于
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush the used works instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NJiri Kosina <jkosina@suse.cz>
      Acked-by: NDavid Sterba <dsterba@suse.cz>
      404437ef
    • T
      ocfs2: don't use flush_scheduled_work() · 9b00a818
      Tejun Heo 提交于
      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: NTejun Heo <tj@kernel.org>
      Acked-by: NJoel Becker <joel.becker@oracle.com>
      Cc: Mark Fasheh <mfasheh@suse.com>
      9b00a818
    • T
      net/dsa: don't use flush_scheduled_work() · 7f6b0db9
      Tejun Heo 提交于
      flush_scheduled_work() is deprecated and scheduled to be removed.
      Directly flush dst->link_poll_work on remove instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NLennert Buytenhek <buytenh@wantstofly.org>
      7f6b0db9
    • T
      isdn/capi: make kcapi use a separate workqueue · 158fa677
      Tejun Heo 提交于
      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: NTejun Heo <tj@kernel.org>
      Acked-by: NJan Kiszka <jan.kiszka@web.de>
      158fa677
    • T
      isdn/capi: unregister capictr notifier after init failure · 7fa5e85a
      Tejun Heo 提交于
      capidrv_init() could leave capictr notifier dangling after init
      failure.  Fix it.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NJan Kiszka <jan.kiszka@web.de>
      7fa5e85a
  2. 21 12月, 2010 1 次提交
    • T
      workqueue: allow chained queueing during destruction · c8efcc25
      Tejun Heo 提交于
      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: NTejun Heo <tj@kernel.org>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      c8efcc25
  3. 15 12月, 2010 2 次提交
  4. 14 12月, 2010 2 次提交
    • S
      workqueue: It is likely that WORKER_NOT_RUNNING is true · 2d64672e
      Steven Rostedt 提交于
      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: NTejun Heo <tj@kernel.org>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      2d64672e
    • T
      MAINTAINERS: Add workqueue entry · 3e6cd7a4
      Tejun Heo 提交于
      Signed-off-by: NTejun Heo <tj@kernel.org>
      3e6cd7a4
  5. 26 11月, 2010 1 次提交
  6. 25 11月, 2010 9 次提交