01 Aug, 2018

1 commit


19 Jun, 2017

1 commit

  • When copyying blocks to host-managed zoned block devices, writes must be
    sequential. However, dm_kcopyd_copy() does not guarantee this as writes
    are issued in the completion order of reads, and reads may complete out
    of order despite being issued sequentially.

    Fix this by introducing the DM_KCOPYD_WRITE_SEQ feature flag. This can
    be specified when calling dm_kcopyd_copy() and should be set
    automatically if one of the destinations is a host-managed zoned block
    device. For a split job, the master job maintains the write position at
    which writes must be issued. This is checked with the pop() function
    which is modified to not return any write I/O sub job that is not at the
    correct write position.

    When DM_KCOPYD_WRITE_SEQ is specified for a job, errors cannot be
    ignored and the flag DM_KCOPYD_IGNORE_ERROR is ignored, even if
    specified by the user.

    Signed-off-by: Damien Le Moal
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Bart Van Assche
    Signed-off-by: Mike Snitzer

    Damien Le Moal
     

02 Mar, 2013

1 commit

  • This patch allows the administrator to reduce the rate at which kcopyd
    issues I/O.

    Each module that uses kcopyd acquires a throttle parameter that can be
    set in /sys/module/*/parameters.

    We maintain a history of kcopyd usage by each module in the variables
    io_period and total_period in struct dm_kcopyd_throttle. The actual
    kcopyd activity is calculated as a percentage of time equal to
    "(100 * io_period / total_period)". This is compared with the user-defined
    throttle percentage threshold and if it is exceeded, we sleep.

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

    Mikulas Patocka
     

01 Nov, 2011

1 commit

  • This patch introduces dm_kcopyd_zero() to make it easy to use
    kcopyd to write zeros into the requested areas instead
    instead of copying. It is implemented by passing a NULL
    copying source to dm_kcopyd_copy().

    The forthcoming thin provisioning target uses this.

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

    Mikulas Patocka
     

02 Aug, 2011

1 commit

  • If we write a full chunk in the snapshot, skip reading the origin device
    because the whole chunk will be overwritten anyway.

    This patch changes the snapshot write logic when a full chunk is written.
    In this case:
    1. allocate the exception
    2. dispatch the bio (but don't report the bio completion to device mapper)
    3. write the exception record
    4. report bio completed

    Callbacks must be done through the kcopyd thread, because callbacks must not
    race with each other. So we create two new functions:

    dm_kcopyd_prepare_callback: allocate a job structure and prepare the callback.
    (This function must not be called from interrupt context.)

    dm_kcopyd_do_callback: submit callback.
    (This function may be called from interrupt context.)

    Performance test (on snapshots with 4k chunk size):
    without the patch:
    non-direct-io sequential write (dd): 17.7MB/s
    direct-io sequential write (dd): 20.9MB/s
    non-direct-io random write (mkfs.ext2): 0.44s

    with the patch:
    non-direct-io sequential write (dd): 26.5MB/s
    direct-io sequential write (dd): 33.2MB/s
    non-direct-io random write (mkfs.ext2): 0.27s

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

    Mikulas Patocka
     

29 May, 2011

2 commits


25 Apr, 2008

1 commit