17 Feb, 2017

1 commit

  • The sloppy nature of lockless access to percpu pointers
    (s->current_path) in rr_select_path(), from multiple threads, is
    causing some paths to used more than others -- which results in less
    IO performance being observed.

    Revert these upstream commits to restore truly symmetric round-robin
    IO submission in DM multipath:

    b0b477c dm round robin: use percpu 'repeat_count' and 'current_path'
    802934b dm round robin: do not use this_cpu_ptr() without having preemption disabled

    There is no benefit to all this complexity if repeat_count = 1 (which is
    the recommended default).

    Cc: stable@vger.kernel.org # 4.6+
    Signed-off-by: Mike Snitzer

    Mike Snitzer
     

15 Aug, 2016

1 commit


23 Feb, 2016

4 commits

  • Now that dm-mpath core is lockless in the per-IO fast path it is
    critical, for performance, to have the .select_path hook
    (rr_select_path) also be as lockless as possible.

    The new percpu members of 'struct selector' allow for lockless support
    of 'repeat_count' governed repeat use of a previously selected path. If
    a path fails while it is 'current_path' the worst case is concurrent IO
    might be mapped to the failed path until the .fail_path hook
    (rr_fail_path) is called.

    Signed-off-by: Mike Snitzer

    Mike Snitzer
     
  • If a path selector has any use for a repeat_count it should be handled
    locally and not depend on the dm-mpath core to be concerned with it.

    Signed-off-by: Mike Snitzer

    Mike Snitzer
     
  • Proper locking of the lists used by the path selectors should be handled
    within the selectors (relying on dm-mpath.c code's use of the m->lock
    spinlock was reckless).

    Signed-off-by: Mike Snitzer

    Mike Snitzer
     
  • Preparation for making __multipath_map() avoid taking the m->lock
    spinlock -- in favor of using RCU locking.

    repeat_count was primarily for bio-based DM multipath's benefit. There
    is really no need for it anymore now that DM multipath is request-based.
    As such, repeat_count > 1 is no longer honored and a warning is
    displayed if the user attempts to use a value > 1. This is a temporary
    change for the round-robin path-selector (as a later commit will restore
    its support for repeat_count > 1).

    Signed-off-by: Mike Snitzer

    Mike Snitzer
     

29 Mar, 2012

1 commit

  • Device mapper uses sscanf to convert arguments to numbers. The problem is that
    the way we use it ignores additional unmatched characters in the scanned string.

    For example, this `if (sscanf(string, "%d", &number) == 1)' will match a number,
    but also it will match number with some garbage appended, like "123abc".

    As a result, device mapper accepts garbage after some numbers. For example
    the command `dmsetup create vg1-new --table "0 16384 linear 254:1bla 34816bla"'
    will pass without an error.

    This patch fixes all sscanf uses in device mapper. It appends "%c" with
    a pointer to a dummy character variable to every sscanf statement.

    The construct `if (sscanf(string, "%d%c", &number, &dummy) == 1)' succeeds
    only if string is a null-terminated number (optionally preceded by some
    whitespace characters). If there is some character appended after the number,
    sscanf matches "%c", writes the character to the dummy variable and returns 2.
    We check the return value for 1 and consequently reject numbers with some
    garbage appended.

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

    Mikulas Patocka
     

01 Nov, 2011

1 commit


22 Jun, 2009

1 commit

  • This patch makes two additions to the dm path selector interface for
    dynamic load balancers:
    o a new hook, start_io()
    o a new parameter 'nr_bytes' to select_path()/start_io()/end_io()
    to pass the size of the I/O

    start_io() is called when a target driver actually submits I/O
    to the selected path.
    Path selectors can use it to start accounting of the I/O.
    (e.g. counting the number of in-flight I/Os.)
    The start_io hook is based on the patch posted by Stefan Bader:
    https://www.redhat.com/archives/dm-devel/2005-October/msg00050.html

    nr_bytes, the size of the I/O, is so path selectors can take the
    size of the I/O into account when deciding which path to use.
    dm-service-time uses it to estimate service time, for example.
    (Added the nr_bytes member to dm_mpath_io instead of using existing
    details.bi_size, since request-based dm patch deletes it.)

    Signed-off-by: Stefan Bader
    Signed-off-by: Kiyoshi Ueda
    Signed-off-by: Jun'ichi Nomura
    Signed-off-by: Alasdair G Kergon

    Kiyoshi Ueda
     

22 Oct, 2008

1 commit


13 Jul, 2007

1 commit


09 Dec, 2006

1 commit


09 Nov, 2006

1 commit


27 Jun, 2006

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds