24 Dec, 2010

25 commits

  • 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: Tejun Heo
    Cc: Andrew Morton

    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: Tejun Heo
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: linux390@de.ibm.com
    Cc: linux-s390@vger.kernel.org

    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: Tejun Heo
    Cc: Alessandro Zummo
    Cc: rtc-linux@googlegroups.com

    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: Tejun Heo
    Cc: Chris Ball
    Cc: linux-mmc@vger.kernel.org

    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: Tejun Heo
    Cc: Samuel Ortiz

    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: Tejun Heo
    Cc: Mauro Carvalho Chehab
    Cc: linux-media@vger.kernel.org

    Tejun Heo
     
  • flush_scheduled_work() is deprecated and scheduled to be removed.
    Directly flush led->work on removal instead.

    Signed-off-by: Tejun Heo
    Cc: Richard Purdie

    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: Tejun Heo
    Cc: Karsten Keil
    Cc: netdev@vger.kernel.org

    Tejun Heo
     
  • flush_scheduled_work() is deprecated and scheduled to be removed.
    Directly flush ams_info.worker on detach instead.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • flush_scheduled_work() is deprecated and scheduled to be removed.
    Directly flush info->deferred_work on removal instead.

    Signed-off-by: Tejun Heo
    Cc: Thomas Hellstrom

    Tejun Heo
     
  • flush_scheduled_work() is deprecated and scheduled to be removed.
    Directly flush chip->work instead.

    Signed-off-by: Tejun Heo
    Cc: Debora Velarde
    Cc: Rajiv Andrade

    Tejun Heo
     
  • flush_scheduled_work() is deprecated and scheduled to be removed.
    Directly flush sonypi_device.input_work on removal instead.

    Signed-off-by: Tejun Heo
    Cc: Mattia Dongili

    Tejun Heo
     
  • flush_scheduled_work() is deprecated and scheduled to be removed.
    Directly cancel hp->writer and flush hp->handshaker instead.

    Signed-off-by: Tejun Heo
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras

    Tejun Heo
     
  • flush_scheduled_work() is deprecated and scheduled to be removed.
    Directly flush info->work instead.

    Signed-off-by: Tejun Heo
    Cc: Jeremy Fitzhardinge
    Cc: Konrad Rzeszutek Wilk

    Tejun Heo
     
  • flush_scheduled_work() is deprecated and scheduled to be removed.
    Directly flush work on removal instead.

    Signed-off-by: Tejun Heo
    Cc: Jens Axboe

    Tejun Heo
     
  • flush_scheduled_work() is deprecated and scheduled to be removed.
    Directly flush floppy_work instead.

    Signed-off-by: Tejun Heo
    Cc: Jens Axboe

    Tejun Heo
     
  • flush_scheduled_work() is deprecated and scheduled to be removed.
    Directly flush psw->work on removal instead.

    Signed-off-by: Tejun Heo
    Cc: Paul Mundt
    Cc: linux-sh@vger.kernel.org

    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: Tejun Heo
    Cc: Russell King

    Tejun Heo
     
  • flush_scheduled_work() is deprecated and scheduled to be removed.
    Directly flush the used works on stop instead.

    Signed-off-by: Tejun Heo
    Cc: Petr Vandrovec

    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: Tejun Heo
    Cc:: Thomas Hellstrom
    Cc:: Dave Airlie

    Tejun Heo
     
  • flush_scheduled_work() is deprecated and scheduled to be removed.
    Directly flush the used works instead.

    Signed-off-by: Tejun Heo
    Acked-by: Jiri Kosina
    Acked-by: David Sterba

    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: Tejun Heo
    Acked-by: Joel Becker
    Cc: Mark Fasheh

    Tejun Heo
     
  • flush_scheduled_work() is deprecated and scheduled to be removed.
    Directly flush dst->link_poll_work on remove instead.

    Signed-off-by: Tejun Heo
    Acked-by: Lennert Buytenhek

    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: Tejun Heo
    Acked-by: Jan Kiszka

    Tejun Heo
     
  • capidrv_init() could leave capictr notifier dangling after init
    failure. Fix it.

    Signed-off-by: Tejun Heo
    Acked-by: Jan Kiszka

    Tejun Heo
     

21 Dec, 2010

1 commit

  • 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: Tejun Heo
    Cc: James Bottomley

    Tejun Heo
     

15 Dec, 2010

2 commits

  • There's no in-kernel user left for these two obsolete functions. Mark
    them deprecated and schedule for removal during 2.6.39 cycle.

    Signed-off-by: Tejun Heo
    Acked-by: David S. Miller

    Tejun Heo
     
  • cancel_rearming_delayed_work[queue]() has been superceded by
    cancel_delayed_work_sync() quite some time ago. Convert all the
    in-kernel users. The conversions are completely equivalent and
    trivial.

    Signed-off-by: Tejun Heo
    Acked-by: "David S. Miller"
    Acked-by: Greg Kroah-Hartman
    Acked-by: Evgeniy Polyakov
    Cc: Jeff Garzik
    Cc: Benjamin Herrenschmidt
    Cc: Mauro Carvalho Chehab
    Cc: netdev@vger.kernel.org
    Cc: Anton Vorontsov
    Cc: David Woodhouse
    Cc: "J. Bruce Fields"
    Cc: Neil Brown
    Cc: Alex Elder
    Cc: xfs-masters@oss.sgi.com
    Cc: Christoph Lameter
    Cc: Pekka Enberg
    Cc: Andrew Morton
    Cc: netfilter-devel@vger.kernel.org
    Cc: Trond Myklebust
    Cc: linux-nfs@vger.kernel.org

    Tejun Heo
     

14 Dec, 2010

2 commits

  • 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: Tejun Heo
    Signed-off-by: Steven Rostedt
    Signed-off-by: Tejun Heo

    Steven Rostedt
     
  • Signed-off-by: Tejun Heo

    Tejun Heo
     

26 Nov, 2010

1 commit


25 Nov, 2010

9 commits