15 Feb, 2017

1 commit


06 Jan, 2017

1 commit

  • commit d15bb3a6467e102e60d954aadda5fb19ce6fd8ec upstream.

    It is required to hold the queue lock when calling blk_run_queue_async()
    to avoid that a race between blk_run_queue_async() and
    blk_cleanup_queue() is triggered.

    Signed-off-by: Bart Van Assche
    Signed-off-by: Mike Snitzer
    Signed-off-by: Greg Kroah-Hartman

    Bart Van Assche
     

29 Oct, 2016

1 commit

  • Pull device mapper fixes from Mike Snitzer:

    - a couple DM raid and DM mirror fixes

    - a couple .request_fn request-based DM NULL pointer fixes

    - a fix for a DM target reference count leak, on target load error,
    that prevented associated DM target kernel module(s) from being
    removed

    * tag 'dm-4.9-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
    dm table: fix missing dm_put_target_type() in dm_table_add_target()
    dm rq: clear kworker_task if kthread_run() returned an error
    dm: free io_barrier after blk_cleanup_queue call
    dm raid: fix activation of existing raid4/10 devices
    dm mirror: use all available legs on multiple failures
    dm mirror: fix read error on recovery after default leg failure
    dm raid: fix compat_features validation

    Linus Torvalds
     

19 Oct, 2016

1 commit

  • cleanup_mapped_device() calls kthread_stop() if kworker_task is
    non-NULL. Currently the assigned value could be a valid task struct or
    an error code (e.g -ENOMEM). Reset md->kworker_task to NULL if
    kthread_run() returned an erorr.

    Fixes: 7193a9defc ("dm rq: check kthread_run return for .request_fn request-based DM")
    Cc: stable@vger.kernel.org # 4.8
    Reported-by: Tahsin Erdogan
    Signed-off-by: Mike Snitzer

    Mike Snitzer
     

12 Oct, 2016

1 commit

  • A good practice is to prefix the names of functions by the name
    of the subsystem.

    The kthread worker API is a mix of classic kthreads and workqueues. Each
    worker has a dedicated kthread. It runs a generic function that process
    queued works. It is implemented as part of the kthread subsystem.

    This patch renames the existing kthread worker API to use
    the corresponding name from the workqueues API prefixed by
    kthread_:

    __init_kthread_worker() -> __kthread_init_worker()
    init_kthread_worker() -> kthread_init_worker()
    init_kthread_work() -> kthread_init_work()
    insert_kthread_work() -> kthread_insert_work()
    queue_kthread_work() -> kthread_queue_work()
    flush_kthread_work() -> kthread_flush_work()
    flush_kthread_worker() -> kthread_flush_worker()

    Note that the names of DEFINE_KTHREAD_WORK*() macros stay
    as they are. It is common that the "DEFINE_" prefix has
    precedence over the subsystem names.

    Note that INIT() macros and init() functions use different
    naming scheme. There is no good solution. There are several
    reasons for this solution:

    + "init" in the function names stands for the verb "initialize"
    aka "initialize worker". While "INIT" in the macro names
    stands for the noun "INITIALIZER" aka "worker initializer".

    + INIT() macros are used only in DEFINE() macros

    + init() functions are used close to the other kthread()
    functions. It looks much better if all the functions
    use the same scheme.

    + There will be also kthread_destroy_worker() that will
    be used close to kthread_cancel_work(). It is related
    to the init() function. Again it looks better if all
    functions use the same naming scheme.

    + there are several precedents for such init() function
    names, e.g. amd_iommu_init_device(), free_area_init_node(),
    jump_label_init_type(), regmap_init_mmio_clk(),

    + It is not an argument but it was inconsistent even before.

    [arnd@arndb.de: fix linux-next merge conflict]
    Link: http://lkml.kernel.org/r/20160908135724.1311726-1-arnd@arndb.de
    Link: http://lkml.kernel.org/r/1470754545-17632-3-git-send-email-pmladek@suse.com
    Suggested-by: Andrew Morton
    Signed-off-by: Petr Mladek
    Cc: Oleg Nesterov
    Cc: Tejun Heo
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: "Paul E. McKenney"
    Cc: Josh Triplett
    Cc: Thomas Gleixner
    Cc: Jiri Kosina
    Cc: Borislav Petkov
    Cc: Michal Hocko
    Cc: Vlastimil Babka
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Petr Mladek
     

10 Oct, 2016

2 commits

  • Pull blk-mq irq/cpu mapping updates from Jens Axboe:
    "This is the block-irq topic branch for 4.9-rc. It's mostly from
    Christoph, and it allows drivers to specify their own mappings, and
    more importantly, to share the blk-mq mappings with the IRQ affinity
    mappings. It's a good step towards making this work better out of the
    box"

    * 'for-4.9/block-irq' of git://git.kernel.dk/linux-block:
    blk_mq: linux/blk-mq.h does not include all the headers it depends on
    blk-mq: kill unused blk_mq_create_mq_map()
    blk-mq: get rid of the cpumask in struct blk_mq_tags
    nvme: remove the post_scan callout
    nvme: switch to use pci_alloc_irq_vectors
    blk-mq: provide a default queue mapping for PCI device
    blk-mq: allow the driver to pass in a queue mapping
    blk-mq: remove ->map_queue
    blk-mq: only allocate a single mq_map per tag_set
    blk-mq: don't redistribute hardware queues on a CPU hotplug event

    Linus Torvalds
     
  • Pull device mapper updates from Mike Snitzer:

    - various fixes and cleanups for request-based DM core

    - add support for delaying the requeue of requests; used by DM
    multipath when all paths have failed and 'queue_if_no_path' is
    enabled

    - DM cache improvements to speedup the loading metadata and the writing
    of the hint array

    - fix potential for a dm-crypt crash on device teardown

    - remove dm_bufio_cond_resched() and just using cond_resched()

    - change DM multipath to return a reservation conflict error
    immediately; rather than failing the path and retrying (potentially
    indefinitely)

    * tag 'dm-4.9-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: (24 commits)
    dm mpath: always return reservation conflict without failing over
    dm bufio: remove dm_bufio_cond_resched()
    dm crypt: fix crash on exit
    dm cache metadata: switch to using the new cursor api for loading metadata
    dm array: introduce cursor api
    dm btree: introduce cursor api
    dm cache policy smq: distribute entries to random levels when switching to smq
    dm cache: speed up writing of the hint array
    dm array: add dm_array_new()
    dm mpath: delay the requeue of blk-mq requests while all paths down
    dm mpath: use dm_mq_kick_requeue_list()
    dm rq: introduce dm_mq_kick_requeue_list()
    dm rq: reduce arguments passed to map_request() and dm_requeue_original_request()
    dm rq: add DM_MAPIO_DELAY_REQUEUE to delay requeue of blk-mq requests
    dm: convert wait loops to use autoremove_wake_function()
    dm: use signal_pending_state() in dm_wait_for_completion()
    dm: rename task state function arguments
    dm: add two lockdep_assert_held() statements
    dm rq: simplify dm_old_stop_queue()
    dm mpath: check if path's request_queue is dying in activate_path()
    ...

    Linus Torvalds
     

21 Sep, 2016

1 commit


15 Sep, 2016

7 commits


03 Aug, 2016

1 commit

  • Improve dm_stop_queue() to cancel any requeue_work. Also, have
    dm_start_queue() and dm_stop_queue() clear/set the QUEUE_FLAG_STOPPED
    for the blk-mq request_queue.

    On suspend dm_stop_queue() handles stopping the blk-mq request_queue
    BUT: even though the hw_queues are marked BLK_MQ_S_STOPPED at that point
    there is still a race that is allowing block/blk-mq.c to call ->queue_rq
    against a hctx that it really shouldn't. Add a check to
    dm_mq_queue_rq() that guards against this rarity (albeit _not_
    race-free).

    Signed-off-by: Mike Snitzer
    Cc: stable@vger.kernel.org # must patch dm.c on < 4.8 kernels

    Mike Snitzer
     

19 Jul, 2016

1 commit

  • Commit d548b34b062 ("dm: reduce the queue delay used in dm_request_fn
    from 100ms to 10ms") always intended the value to be 10 msecs -- it
    just expressed it in jiffies because earlier commit 7eaceaccab ("block:
    remove per-queue plugging") did.

    Signed-off-by: Tahsin Erdogan
    Signed-off-by: Mike Snitzer
    Fixes: d548b34b062 ("dm: reduce the queue delay used in dm_request_fn from 100ms to 10ms")
    Cc: stable@vger.kernel.org # 4.1+ -- stable@ backports must be applied to drivers/md/dm.c

    Tahsin Erdogan
     

06 Jul, 2016

1 commit


11 Jun, 2016

2 commits

  • Allow a user to specify an optional feature 'queue_mode ' where
    may be "bio", "rq" or "mq" -- which corresponds to bio-based,
    request_fn rq-based, and blk-mq rq-based respectively.

    If the queue_mode feature isn't specified the default for the
    "multipath" target is still "rq" but if dm_mod.use_blk_mq is set to Y
    it'll default to mode "mq".

    This new queue_mode feature introduces the ability for each multipath
    device to have its own queue_mode (whereas before this feature all
    multipath devices effectively had to have the same queue_mode).

    This commit also goes a long way to eliminate the awkward (ab)use of
    DM_TYPE_*, the associated filter_md_type() and other relatively fragile
    and difficult to maintain code.

    Signed-off-by: Mike Snitzer

    Mike Snitzer
     
  • Add some seperation between bio-based and request-based DM core code.

    'struct mapped_device' and other DM core only structures and functions
    have been moved to dm-core.h and all relevant DM core .c files have been
    updated to include dm-core.h rather than dm.h

    DM targets should _never_ include dm-core.h!

    [block core merge conflict resolution from Stephen Rothwell]
    Signed-off-by: Mike Snitzer
    Signed-off-by: Stephen Rothwell

    Mike Snitzer