30 Sep, 2020

1 commit


09 Jul, 2020

1 commit

  • Except for pktdvd, the only places setting congested bits are file
    systems that allocate their own backing_dev_info structures. And
    pktdvd is a deprecated driver that isn't useful in stack setup
    either. So remove the dead congested_fn stacking infrastructure.

    Signed-off-by: Christoph Hellwig
    Acked-by: Song Liu
    Acked-by: David Sterba
    [axboe: fixup unused variables in bcache/request.c]
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

23 Aug, 2019

1 commit

  • Currently, if we pass too high sector number to dm_table_find_target, it
    returns zeroed dm_target structure and callers test if the structure is
    zeroed with the macro dm_target_is_valid.

    However, returning NULL is common practice to indicate errors.

    This patch refactors the dm code, so that dm_table_find_target returns
    NULL and its callers test the returned value for NULL. The macro
    dm_target_is_valid is deleted. In alloc_targets, we no longer allocate an
    extra zeroed target.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Mikulas Patocka
     

06 Jul, 2019

1 commit

  • This patch sets dax device 'DAXDEV_SYNC' flag if all the target
    devices of device mapper support synchrononous DAX. If device
    mapper consists of both synchronous and asynchronous dax devices,
    we don't set 'DAXDEV_SYNC' flag.

    'dm_table_supports_dax' is refactored to pass 'iterate_devices_fn'
    as argument so that the callers can pass the appropriate functions.

    Suggested-by: Mike Snitzer
    Signed-off-by: Pankaj Gupta
    Reviewed-by: Mike Snitzer
    Signed-off-by: Dan Williams

    Pankaj Gupta
     

21 May, 2019

1 commit

  • Pankaj reports that starting with commit ad428cdb525a "dax: Check the
    end of the block-device capacity with dax_direct_access()" device-mapper
    no longer allows dax operation. This results from the stricter checks in
    __bdev_dax_supported() that validate that the start and end of a
    block-device map to the same 'pagemap' instance.

    Teach the dax-core and device-mapper to validate the 'pagemap' on a
    per-target basis. This is accomplished by refactoring the
    bdev_dax_supported() internals into generic_fsdax_supported() which
    takes a sector range to validate. Consequently generic_fsdax_supported()
    is suitable to be used in a device-mapper ->iterate_devices() callback.
    A new ->dax_supported() operation is added to allow composite devices to
    split and route upper-level bdev_dax_supported() requests.

    Fixes: ad428cdb525a ("dax: Check the end of the block-device...")
    Cc:
    Cc: Ira Weiny
    Cc: Dave Jiang
    Cc: Keith Busch
    Cc: Matthew Wilcox
    Cc: Vishal Verma
    Cc: Heiko Carstens
    Cc: Martin Schwidefsky
    Reviewed-by: Jan Kara
    Reported-by: Pankaj Gupta
    Reviewed-by: Pankaj Gupta
    Tested-by: Pankaj Gupta
    Tested-by: Vaibhav Jain
    Reviewed-by: Mike Snitzer
    Signed-off-by: Dan Williams

    Dan Williams
     

11 Oct, 2018

1 commit


17 Jan, 2018

1 commit


14 Dec, 2017

1 commit


25 Oct, 2017

1 commit

  • atomic_t variables are currently used to implement reference
    counters with the following properties:
    - counter is initialized to 1 using atomic_set()
    - a resource is freed upon counter reaching zero
    - once counter reaches zero, its further
    increments aren't allowed
    - counter schema uses basic atomic operations
    (set, inc, inc_not_zero, dec_and_test, etc.)

    Such atomic variables should be converted to a newly provided
    refcount_t type and API that prevents accidental counter overflows
    and underflows. This is important since overflows and underflows
    can lead to use-after-free situation and be exploitable.

    The variable dm_dev_internal.count is used as pure reference counter.
    Convert it to refcount_t and fix up the operations.

    Suggested-by: Kees Cook
    Reviewed-by: David Windsor
    Reviewed-by: Hans Liljestrand
    Signed-off-by: Elena Reshetova
    Signed-off-by: Mike Snitzer

    Elena Reshetova
     

28 Apr, 2017

1 commit


28 Jan, 2017

1 commit

  • DM already calls blk_mq_alloc_request on the request_queue of the
    underlying device if it is a blk-mq device. But now that we allow drivers
    to allocate additional data and initialize it ahead of time we need to do
    the same for all drivers. Doing so and using the new cmd_size
    infrastructure in the block layer greatly simplifies the dm-rq and mpath
    code, and should also make arbitrary combinations of SQ and MQ devices
    with SQ or MQ device mapper tables easily possible as a further step.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Mike Snitzer
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

21 Jul, 2016

1 commit

  • Change mapped device to implement direct_access function,
    dm_blk_direct_access(), which calls a target direct_access function.
    'struct target_type' is extended to have target direct_access interface.
    This function limits direct accessible size to the dm_target's limit
    with max_io_len().

    Add dm_table_supports_dax() to iterate all targets and associated block
    devices to check for DAX support. To add DAX support to a DM target the
    target must only implement the direct_access function.

    Add a new dm type, DM_TYPE_DAX_BIO_BASED, which indicates that mapped
    device supports DAX and is bio based. This new type is used to assure
    that all target devices have DAX support and remain that way after
    QUEUE_FLAG_DAX is set in mapped device.

    At initial table load, QUEUE_FLAG_DAX is set to mapped device when setting
    DM_TYPE_DAX_BIO_BASED to the type. Any subsequent table load to the
    mapped device must have the same type, or else it fails per the check in
    table_load().

    Signed-off-by: Toshi Kani
    Signed-off-by: Mike Snitzer

    Toshi Kani
     

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
     

23 Feb, 2016

3 commits

  • This will allow DM multipath to use a portion of the blk-mq pdu space
    for target data (e.g. struct dm_mpath_io).

    Signed-off-by: Mike Snitzer

    Mike Snitzer
     
  • DM multipath is the only dm-mq target. But that aside, request-based DM
    only supports tables with a single target that is immutable. Leverage
    this fact in dm_mq_queue_rq() by using the 'immutable_target' stored in
    the mapped_device when the table was made active. This saves the need
    to even take the read-side of the SRCU via dm_{get,put}_live_table.

    If the active DM table does not have an immutable target (e.g. "error"
    target was swapped in) then fallback to the slow-path where the target
    is looked up from the live table.

    Signed-off-by: Mike Snitzer

    Mike Snitzer
     
  • The DM_TARGET_WILDCARD feature indicates that the "error" target may
    replace any target; even immutable targets. This feature will be useful
    to preserve the ability to replace the "multipath" target even once it
    is formally converted over to having the DM_TARGET_IMMUTABLE feature.

    Also, implicit in the DM_TARGET_WILDCARD feature flag being set is that
    .map, .map_rq, .clone_and_map_rq and .release_clone_rq are all defined
    in the target_type.

    Signed-off-by: Mike Snitzer

    Mike Snitzer
     

14 Aug, 2015

1 commit

  • As generic_make_request() is now able to handle arbitrarily sized bios,
    it's no longer necessary for each individual block driver to define its
    own ->merge_bvec_fn() callback. Remove every invocation completely.

    Cc: Jens Axboe
    Cc: Lars Ellenberg
    Cc: drbd-user@lists.linbit.com
    Cc: Jiri Kosina
    Cc: Yehuda Sadeh
    Cc: Sage Weil
    Cc: Alex Elder
    Cc: ceph-devel@vger.kernel.org
    Cc: Alasdair Kergon
    Cc: Mike Snitzer
    Cc: dm-devel@redhat.com
    Cc: Neil Brown
    Cc: linux-raid@vger.kernel.org
    Cc: Christoph Hellwig
    Cc: "Martin K. Petersen"
    Acked-by: NeilBrown (for the 'md' bits)
    Acked-by: Mike Snitzer
    Signed-off-by: Kent Overstreet
    [dpark: also remove ->merge_bvec_fn() in dm-thin as well as
    dm-era-target, and resolve merge conflicts]
    Signed-off-by: Dongsu Park
    Signed-off-by: Ming Lin
    Signed-off-by: Jens Axboe

    Kent Overstreet
     

27 Jun, 2015

1 commit

  • Pull device mapper fixes from Mike Snitzer:
    "Apologies for not pressing this request-based DM partial completion
    issue further, it was an oversight on my part. We'll have to get it
    fixed up properly and revisit for a future release.

    - Revert block and DM core changes the removed request-based DM's
    ability to handle partial request completions -- otherwise with the
    current SCSI LLDs these changes could lead to silent data
    corruption.

    - Fix two DM version bumps that were missing from the initial 4.2 DM
    pull request (enabled userspace lvm2 to know certain changes have
    been made)"

    * tag 'dm-4.2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
    dm cache policy smq: fix "default" version to be 1.4.0
    dm: bump the ioctl version to 4.32.0
    Revert "block, dm: don't copy bios for request clones"
    Revert "dm: do not allocate any mempools for blk-mq request-based DM"

    Linus Torvalds
     

26 Jun, 2015

1 commit

  • This reverts commit 5f1b670d0bef508a5554d92525f5f6d00d640b38.

    Justification for revert as reported in this dm-devel post:
    https://www.redhat.com/archives/dm-devel/2015-June/msg00160.html

    this change should not be pushed to mainline yet.

    Firstly, Christoph has a newer version of the patch that fixes silent
    data corruption problem:
    https://www.redhat.com/archives/dm-devel/2015-May/msg00229.html

    And the new version still depends on LLDDs to always complete requests
    to the end when error happens, while block API doesn't enforce such a
    requirement. If the assumption is ever broken, the inconsistency between
    request and bio (e.g. rq->__sector and rq->bio) will cause silent data
    corruption:
    https://www.redhat.com/archives/dm-devel/2015-June/msg00022.html

    Reported-by: Junichi Nomura
    Signed-off-by: Mike Snitzer

    Mike Snitzer
     

02 Jun, 2015

1 commit

  • With the planned cgroup writeback support, backing-dev related
    declarations will be more widely used across block and cgroup;
    unfortunately, including backing-dev.h from include/linux/blkdev.h
    makes cyclic include dependency quite likely.

    This patch separates out backing-dev-defs.h which only has the
    essential definitions and updates blkdev.h to include it. c files
    which need access to more backing-dev details now include
    backing-dev.h directly. This takes backing-dev.h off the common
    include dependency chain making it a lot easier to use it across block
    and cgroup.

    v2: fs/fat build failure fixed.

    Signed-off-by: Tejun Heo
    Reviewed-by: Jan Kara
    Cc: Jens Axboe
    Signed-off-by: Jens Axboe

    Tejun Heo
     

22 May, 2015

1 commit

  • Currently dm-multipath has to clone the bios for every request sent
    to the lower devices, which wastes cpu cycles and ties down memory.

    This patch instead adds a new REQ_CLONE flag that instructs req_bio_endio
    to not complete bios attached to a request, which we set on clone
    requests similar to bios in a flush sequence. With this change I/O
    errors on a path failure only get propagated to dm-multipath, which
    can then either resubmit the I/O or complete the bios on the original
    request.

    I've done some basic testing of this on a Linux target with ALUA support,
    and it survives path failures during I/O nicely.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Mike Snitzer
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

16 Apr, 2015

2 commits

  • Request-based DM's blk-mq support defaults to off; but a user can easily
    change the default using the dm_mod.use_blk_mq module/boot option.

    Also, you can check what mode a given request-based DM device is using
    with: cat /sys/block/dm-X/dm/use_blk_mq

    This change enabled further cleanup and reduced work (e.g. the
    md->io_pool and md->rq_pool isn't created if using blk-mq).

    Signed-off-by: Mike Snitzer

    Mike Snitzer
     
  • Otherwise, for sequential workloads, the dm_request_fn can allow
    excessive request merging at the expense of increased service time.

    Add a per-device sysfs attribute to allow the user to control how long a
    request, that is a reasonable merge candidate, can be queued on the
    request queue. The resolution of this request dispatch deadline is in
    microseconds (ranging from 1 to 100000 usecs), to set a 20us deadline:
    echo 20 > /sys/block/dm-7/dm/rq_based_seq_io_merge_deadline

    The dm_request_fn's merge heuristic and associated extra accounting is
    disabled by default (rq_based_seq_io_merge_deadline is 0).

    This sysfs attribute is not applicable to bio-based DM devices so it
    will only ever report 0 for them.

    By allowing a request to remain on the queue it will block others
    requests on the queue. But introducing a short dequeue delay has proven
    very effective at enabling certain sequential IO workloads on really
    fast, yet IOPS constrained, devices to build up slightly larger IOs --
    yielding 90+% throughput improvements. Having precise control over the
    time taken to wait for larger requests to build affords control beyond
    that of waiting for certain IO sizes to accumulate (which would require
    a deadline anyway). This knob will only ever make sense with sequential
    IO workloads and the particular value used is storage configuration
    specific.

    Given the expected niche use-case for when this knob is useful it has
    been deemed acceptable to expose this relatively crude method for
    crafting optimal IO on specific storage -- especially given the solution
    is simple yet effective. In the context of DM multipath, it is
    advisable to tune this sysfs attribute to a value that offers the best
    performance for the common case (e.g. if 4 paths are expected active,
    tune for that; if paths fail then performance may be slightly reduced).

    Alternatives were explored to have request-based DM autotune this value
    (e.g. if/when paths fail) but they were quickly deemed too fragile and
    complex to warrant further design and development time. If this problem
    proves more common as faster storage emerges we'll have to look at
    elevating a generic solution into the block core.

    Tested-by: Shiva Krishna Merla
    Signed-off-by: Mike Snitzer

    Mike Snitzer
     

01 Apr, 2015

1 commit

  • DM multipath is the only caller of blk_lld_busy() -- which calls a
    queue's lld_busy_fn hook. Request-based DM doesn't support stacking
    multipath devices so there is no reason to register the lld_busy_fn hook
    on a multipath device's queue using blk_queue_lld_busy().

    As such, remove functions dm_lld_busy and dm_table_any_busy_target.

    Signed-off-by: Mike Snitzer

    Mike Snitzer
     

10 Feb, 2015

2 commits

  • Otherwise replacing the multipath target with the error target fails:
    device-mapper: ioctl: can't change device type after initial table load.

    The error target was mistakenly considered to be target type
    DM_TYPE_REQUEST_BASED rather than DM_TYPE_MQ_REQUEST_BASED even if the
    target it was to replace was of type DM_TYPE_MQ_REQUEST_BASED.

    Signed-off-by: Mike Snitzer

    Mike Snitzer
     
  • For blk-mq request-based DM the responsibility of allocating a cloned
    request is transfered from DM core to the target type. Doing so
    enables the cloned request to be allocated from the appropriate
    blk-mq request_queue's pool (only the DM target, e.g. multipath, can
    know which block device to send a given cloned request to).

    Care was taken to preserve compatibility with old-style block request
    completion that requires request-based DM _not_ acquire the clone
    request's queue lock in the completion path. As such, there are now 2
    different request-based DM target_type interfaces:
    1) the original .map_rq() interface will continue to be used for
    non-blk-mq devices -- the preallocated clone request is passed in
    from DM core.
    2) a new .clone_and_map_rq() and .release_clone_rq() will be used for
    blk-mq devices -- blk_get_request() and blk_put_request() are used
    respectively from these hooks.

    dm_table_set_type() was updated to detect if the request-based target is
    being stacked on blk-mq devices, if so DM_TYPE_MQ_REQUEST_BASED is set.
    DM core disallows switching the DM table's type after it is set. This
    means that there is no mixing of non-blk-mq and blk-mq devices within
    the same request-based DM table.

    [This patch was started by Keith and later heavily modified by Mike]

    Tested-by: Bart Van Assche
    Signed-off-by: Keith Busch
    Signed-off-by: Mike Snitzer

    Mike Snitzer
     

20 Nov, 2014

2 commits

  • Rename dm_internal_{suspend,resume} to dm_internal_{suspend,resume}_fast
    -- dm-stats will continue using these methods to avoid all the extra
    suspend/resume logic that is not needed in order to quickly flush IO.

    Introduce dm_internal_suspend_noflush() variant that actually calls the
    mapped_device's target callbacks -- otherwise target-specific hooks are
    avoided (e.g. dm-thin's thin_presuspend and thin_postsuspend). Common
    code between dm_internal_{suspend_noflush,resume} and
    dm_{suspend,resume} was factored out as __dm_{suspend,resume}.

    Update dm_internal_{suspend_noflush,resume} to always take and release
    the mapped_device's suspend_lock. Also update dm_{suspend,resume} to be
    aware of potential for DM_INTERNAL_SUSPEND_FLAG to be set and respond
    accordingly by interruptibly waiting for the DM_INTERNAL_SUSPEND_FLAG to
    be cleared. Add lockdep annotation to dm_suspend() and dm_resume().

    The existing DM_SUSPEND_FLAG remains unchanged.
    DM_INTERNAL_SUSPEND_FLAG is set by dm_internal_suspend_noflush() and
    cleared by dm_internal_resume().

    Both DM_SUSPEND_FLAG and DM_INTERNAL_SUSPEND_FLAG may be set if a device
    was already suspended when dm_internal_suspend_noflush() was called --
    this can be thought of as a "nested suspend". A "nested suspend" can
    occur with legacy userspace dm-thin code that might suspend all active
    thin volumes before suspending the pool for resize.

    But otherwise, in the normal dm-thin-pool suspend case moving forward:
    the thin-pool will have DM_SUSPEND_FLAG set and all active thins from
    that thin-pool will have DM_INTERNAL_SUSPEND_FLAG set.

    Also add DM_INTERNAL_SUSPEND_FLAG to status report. This new
    DM_INTERNAL_SUSPEND_FLAG state is being reported to assist with
    debugging (e.g. 'dmsetup info' will report an internally suspended
    device accordingly).

    Signed-off-by: Mike Snitzer
    Acked-by: Joe Thornber

    Mike Snitzer
     
  • The DM thin-pool target now must undo the changes performed during
    pool_presuspend() so introduce presuspend_undo hook in target_type.

    Signed-off-by: Mike Snitzer
    Acked-by: Joe Thornber

    Mike Snitzer
     

06 Oct, 2014

1 commit

  • Until this change, when loading a new DM table, DM core would re-open
    all of the devices in the DM table. Now, DM core will avoid redundant
    device opens (and closes when destroying the old table) if the old
    table already has a device open using the same mode. This is achieved
    by managing reference counts on the table_devices that DM core now
    stores in the mapped_device structure (rather than in the dm_table
    structure). So a mapped_device's active and inactive dm_tables' dm_dev
    lists now just point to the dm_devs stored in the mapped_device's
    table_devices list.

    This improvement in DM core's device reference counting has the
    side-effect of fixing a long-standing limitation of the multipath
    target: a DM multipath table couldn't include any paths that were unusable
    (failed). For example: if all paths have failed and you add a new,
    working, path to the table; you can't use it since the table load would
    fail due to it still containing failed paths. Now a re-load of a
    multipath table can include failed devices and when those devices become
    active again they can be used instantly.

    The device list code in dm.c isn't a straight copy/paste from the code in
    dm-table.c, but it's very close (aside from some variable renames). One
    subtle difference is that find_table_device for the tables_devices list
    will only match devices with the same name and mode. This is because we
    don't want to upgrade a device's mode in the active table when an
    inactive table is loaded.

    Access to the mapped_device structure's tables_devices list requires a
    mutex (tables_devices_lock), so that tables cannot be created and
    destroyed concurrently.

    Signed-off-by: Benjamin Marzinski
    Signed-off-by: Mike Snitzer

    Benjamin Marzinski
     

02 Aug, 2014

1 commit


28 Mar, 2014

2 commits


15 Jan, 2014

1 commit

  • This reverts commit be35f48610 ("dm: wait until embedded kobject is
    released before destroying a device") and provides an improved fix.

    The kobject release code that calls the completion must be placed in a
    non-module file, otherwise there is a module unload race (if the process
    calling dm_kobject_release is preempted and the DM module unloaded after
    the completion is triggered, but before dm_kobject_release returns).

    To fix this race, this patch moves the completion code to dm-builtin.c
    which is always compiled directly into the kernel if BLK_DEV_DM is
    selected.

    The patch introduces a new dm_kobject_holder structure, its purpose is
    to keep the completion and kobject in one place, so that it can be
    accessed from non-module code without the need to export the layout of
    struct mapped_device to that code.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer
    Cc: stable@vger.kernel.org

    Mikulas Patocka
     

08 Jan, 2014

1 commit

  • There may be other parts of the kernel holding a reference on the dm
    kobject. We must wait until all references are dropped before
    deallocating the mapped_device structure.

    The dm_kobject_release method signals that all references are dropped
    via completion. But dm_kobject_release doesn't free the kobject (which
    is embedded in the mapped_device structure).

    This is the sequence of operations:
    * when destroying a DM device, call kobject_put from dm_sysfs_exit
    * wait until all users stop using the kobject, when it happens the
    release method is called
    * the release method signals the completion and should return without
    delay
    * the dm device removal code that waits on the completion continues
    * the dm device removal code drops the dm_mod reference the device had
    * the dm device removal code frees the mapped_device structure that
    contains the kobject

    Using kobject this way should avoid the module unload race that was
    mentioned at the beginning of this thread:
    https://lkml.org/lkml/2014/1/4/83

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer
    Cc: stable@vger.kernel.org

    Mikulas Patocka
     

10 Nov, 2013

1 commit

  • This patch allows the removal of an open device to be deferred until
    it is closed. (Previously such a removal attempt would fail.)

    The deferred remove functionality is enabled by setting the flag
    DM_DEFERRED_REMOVE in the ioctl structure on DM_DEV_REMOVE or
    DM_REMOVE_ALL ioctl.

    On return from DM_DEV_REMOVE, the flag DM_DEFERRED_REMOVE indicates if
    the device was removed immediately or flagged to be removed on close -
    if the flag is clear, the device was removed.

    On return from DM_DEV_STATUS and other ioctls, the flag
    DM_DEFERRED_REMOVE is set if the device is scheduled to be removed on
    closure.

    A device that is scheduled to be deleted can be revived using the
    message "@cancel_deferred_remove". This message clears the
    DMF_DEFERRED_REMOVE flag so that the device won't be deleted on close.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Mike Snitzer

    Mikulas Patocka
     

23 Sep, 2013

2 commits

  • Allow user to change the number of IOs that are reserved by
    bio-based DM's mempools by writing to this file:
    /sys/module/dm_mod/parameters/reserved_bio_based_ios

    The default value is RESERVED_BIO_BASED_IOS (16). The maximum allowed
    value is RESERVED_MAX_IOS (1024).

    Export dm_get_reserved_bio_based_ios() for use by DM targets and core
    code. Switch to sizing dm-io's mempool and bioset using DM core's
    configurable 'reserved_bio_based_ios'.

    Signed-off-by: Mike Snitzer
    Signed-off-by: Frank Mayhar

    Mike Snitzer
     
  • Allow user to change the number of IOs that are reserved by
    request-based DM's mempools by writing to this file:
    /sys/module/dm_mod/parameters/reserved_rq_based_ios

    The default value is RESERVED_REQUEST_BASED_IOS (256). The maximum
    allowed value is RESERVED_MAX_IOS (1024).

    Export dm_get_reserved_rq_based_ios() for use by DM targets and core
    code. Switch to sizing dm-mpath's mempool using DM core's configurable
    'reserved_rq_based_ios'.

    Signed-off-by: Mike Snitzer
    Signed-off-by: Frank Mayhar
    Acked-by: Mikulas Patocka

    Mike Snitzer
     

06 Sep, 2013

2 commits

  • Support the collection of I/O statistics on user-defined regions of
    a DM device. If no regions are defined no statistics are collected so
    there isn't any performance impact. Only bio-based DM devices are
    currently supported.

    Each user-defined region specifies a starting sector, length and step.
    Individual statistics will be collected for each step-sized area within
    the range specified.

    The I/O statistics counters for each step-sized area of a region are
    in the same format as /sys/block/*/stat or /proc/diskstats but extra
    counters (12 and 13) are provided: total time spent reading and
    writing in milliseconds. All these counters may be accessed by sending
    the @stats_print message to the appropriate DM device via dmsetup.

    The creation of DM statistics will allocate memory via kmalloc or
    fallback to using vmalloc space. At most, 1/4 of the overall system
    memory may be allocated by DM statistics. The admin can see how much
    memory is used by reading
    /sys/module/dm_mod/parameters/stats_current_allocated_bytes

    See Documentation/device-mapper/statistics.txt for more details.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     
  • It may be useful to switch a request-based table to the "error" target.
    Enhance the DM core to allow a hybrid target_type which is capable of
    handling either bios (via .map) or requests (via .map_rq).

    Add a request-based map function (.map_rq) to the "error" target_type;
    making it DM's first hybrid target. Train dm_table_set_type() to prefer
    the mapped device's established type (request-based or bio-based). If
    the mapped device doesn't have an established type default to making the
    table with the hybrid target(s) bio-based.

    Tested 'dmsetup wipe_table' to work on both bio-based and request-based
    devices.

    Signed-off-by: Mike Snitzer
    Signed-off-by: Joe Jin
    Signed-off-by: Jun'ichi Nomura
    Acked-by: Mikulas Patocka
    Signed-off-by: Alasdair G Kergon

    Mike Snitzer