07 Mar, 2014

1 commit


22 Feb, 2014

3 commits


12 Feb, 2014

2 commits

  • Make sure we have a proper pairing between starting and requeueing
    requests. Move the dma drain and REQ_END setup into blk_mq_start_request,
    and make sure blk_mq_requeue_request properly undoes them, giving us
    a pair of function to prepare and unprepare a request without leaving
    side effects.

    Together this ensures we always clean up properly after
    BLK_MQ_RQ_QUEUE_BUSY returns from ->queue_rq.

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

    Christoph Hellwig
     
  • rq->errors never has been part of the communication protocol between drivers
    and the block stack and most drivers will not have initialized it.

    Return -EIO to upper layers when the driver returns BLK_MQ_RQ_QUEUE_ERROR
    unconditionally. If a driver want to return a different error it can easily
    do so by returning success after calling blk_mq_end_io itself.

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

    Christoph Hellwig
     

11 Feb, 2014

2 commits

  • Witch to using a preallocated flush_rq for blk-mq similar to what's done
    with the old request path. This allows us to set up the request properly
    with a tag from the actually allowed range and ->rq_disk as needed by
    some drivers. To make life easier we also switch to dynamic allocation
    of ->flush_rq for the old path.

    This effectively reverts most of

    "blk-mq: fix for flush deadlock"

    and

    "blk-mq: Don't reserve a tag for flush request"

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

    Christoph Hellwig
     
  • Rework I/O completions to work more like the old code path. blk_mq_end_io
    now stays out of the business of deferring completions to others CPUs
    and calling blk_mark_rq_complete. The latter is very important to allow
    completing requests that have timed out and thus are already marked completed,
    the former allows using the IPI callout even for driver specific completions
    instead of having to reimplement them.

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

    Christoph Hellwig
     

08 Feb, 2014

4 commits


31 Jan, 2014

1 commit

  • Reserving a tag (request) for flush to avoid dead lock is a overkill. A
    tag is valuable resource. We can track the number of flush requests and
    disallow having too many pending flush requests allocated. With this
    patch, blk_mq_alloc_request_pinned() could do a busy nop (but not a dead
    loop) if too many pending requests are allocated and new flush request
    is allocated. But this should not be a problem, too many pending flush
    requests are very rare case.

    I verified this can fix the deadlock caused by too many pending flush
    requests.

    Signed-off-by: Shaohua Li
    Signed-off-by: Jens Axboe

    Shaohua Li
     

09 Jan, 2014

2 commits

  • 'struct page' has two list_head fields: 'lru' and 'list'. Conveniently,
    they are unioned together. This means that code can use them
    interchangably, which gets horribly confusing.

    The blk-mq made the logical decision to try to use page->list. But, that
    field was actually introduced just for the slub code. ->lru is the right
    field to use outside of slab/slub.

    Signed-off-by: Dave Hansen
    Acked-by: David Rientjes
    Acked-by: Kirill A. Shutemov
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Jens Axboe

    Dave Hansen
     
  • __smp_call_function_single already avoids multiple IPIs by internally
    queing up the items, and now also is available for non-SMP builds as
    a trivially correct stub, so there is no need to wrap it. If the
    additional lock roundtrip cause problems my patch to convert the
    generic IPI code to llists is waiting to get merged will fix it.

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

    Christoph Hellwig
     

04 Jan, 2014

1 commit

  • blk_rq_init() is called in req's complete handler to initialize
    the request, so the members of start_time and start_time_ns might
    become inaccurate when it is allocated in future.

    The patch initializes the two members in blk_mq_rq_ctx_init() to
    fix the problem.

    Signed-off-by: Ming Lei
    Signed-off-by: Jens Axboe

    Ming Lei
     

01 Jan, 2014

4 commits


06 Dec, 2013

1 commit


04 Dec, 2013

1 commit


24 Nov, 2013

1 commit

  • Immutable biovecs are going to require an explicit iterator. To
    implement immutable bvecs, a later patch is going to add a bi_bvec_done
    member to this struct; for now, this patch effectively just renames
    things.

    Signed-off-by: Kent Overstreet
    Cc: Jens Axboe
    Cc: Geert Uytterhoeven
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: "Ed L. Cashin"
    Cc: Nick Piggin
    Cc: Lars Ellenberg
    Cc: Jiri Kosina
    Cc: Matthew Wilcox
    Cc: Geoff Levand
    Cc: Yehuda Sadeh
    Cc: Sage Weil
    Cc: Alex Elder
    Cc: ceph-devel@vger.kernel.org
    Cc: Joshua Morris
    Cc: Philip Kelleher
    Cc: Rusty Russell
    Cc: "Michael S. Tsirkin"
    Cc: Konrad Rzeszutek Wilk
    Cc: Jeremy Fitzhardinge
    Cc: Neil Brown
    Cc: Alasdair Kergon
    Cc: Mike Snitzer
    Cc: dm-devel@redhat.com
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: linux390@de.ibm.com
    Cc: Boaz Harrosh
    Cc: Benny Halevy
    Cc: "James E.J. Bottomley"
    Cc: Greg Kroah-Hartman
    Cc: "Nicholas A. Bellinger"
    Cc: Alexander Viro
    Cc: Chris Mason
    Cc: "Theodore Ts'o"
    Cc: Andreas Dilger
    Cc: Jaegeuk Kim
    Cc: Steven Whitehouse
    Cc: Dave Kleikamp
    Cc: Joern Engel
    Cc: Prasad Joshi
    Cc: Trond Myklebust
    Cc: KONISHI Ryusuke
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Ben Myers
    Cc: xfs@oss.sgi.com
    Cc: Steven Rostedt
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Len Brown
    Cc: Pavel Machek
    Cc: "Rafael J. Wysocki"
    Cc: Herton Ronaldo Krzesinski
    Cc: Ben Hutchings
    Cc: Andrew Morton
    Cc: Guo Chao
    Cc: Tejun Heo
    Cc: Asai Thambi S P
    Cc: Selvan Mani
    Cc: Sam Bradshaw
    Cc: Wei Yongjun
    Cc: "Roger Pau Monné"
    Cc: Jan Beulich
    Cc: Stefano Stabellini
    Cc: Ian Campbell
    Cc: Sebastian Ott
    Cc: Christian Borntraeger
    Cc: Minchan Kim
    Cc: Jiang Liu
    Cc: Nitin Gupta
    Cc: Jerome Marchand
    Cc: Joe Perches
    Cc: Peng Tao
    Cc: Andy Adamson
    Cc: fanchaoting
    Cc: Jie Liu
    Cc: Sunil Mushran
    Cc: "Martin K. Petersen"
    Cc: Namjae Jeon
    Cc: Pankaj Kumar
    Cc: Dan Magenheimer
    Cc: Mel Gorman 6

    Kent Overstreet
     

20 Nov, 2013

2 commits


16 Nov, 2013

1 commit

  • Pull second round of block driver updates from Jens Axboe:
    "As mentioned in the original pull request, the bcache bits were pulled
    because of their dependency on the immutable bio vecs. Kent re-did
    this part and resubmitted it, so here's the 2nd round of (mostly)
    driver updates for 3.13. It contains:

    - The bcache work from Kent.

    - Conversion of virtio-blk to blk-mq. This removes the bio and request
    path, and substitutes with the blk-mq path instead. The end result
    almost 200 deleted lines. Patch is acked by Asias and Christoph, who
    both did a bunch of testing.

    - A removal of bootmem.h include from Grygorii Strashko, part of a
    larger series of his killing the dependency on that header file.

    - Removal of __cpuinit from blk-mq from Paul Gortmaker"

    * 'for-linus' of git://git.kernel.dk/linux-block: (56 commits)
    virtio_blk: blk-mq support
    blk-mq: remove newly added instances of __cpuinit
    bcache: defensively handle format strings
    bcache: Bypass torture test
    bcache: Delete some slower inline asm
    bcache: Use ida for bcache block dev minor
    bcache: Fix sysfs splat on shutdown with flash only devs
    bcache: Better full stripe scanning
    bcache: Have btree_split() insert into parent directly
    bcache: Move spinlock into struct time_stats
    bcache: Kill sequential_merge option
    bcache: Kill bch_next_recurse_key()
    bcache: Avoid deadlocking in garbage collection
    bcache: Incremental gc
    bcache: Add make_btree_freeing_key()
    bcache: Add btree_node_write_sync()
    bcache: PRECEDING_KEY()
    bcache: bch_(btree|extent)_ptr_invalid()
    bcache: Don't bother with bucket refcount for btree node allocations
    bcache: Debug code improvements
    ...

    Linus Torvalds
     

15 Nov, 2013

1 commit


14 Nov, 2013

1 commit

  • The new blk-mq code added new instances of __cpuinit usage.
    We removed this a couple versions ago; we now want to remove
    the compat no-op stubs. Introducing new users is not what
    we want to see at this point in time, as it will break once
    the stubs are gone.

    Signed-off-by: Paul Gortmaker
    Signed-off-by: Jens Axboe

    Paul Gortmaker
     

30 Oct, 2013

1 commit


29 Oct, 2013

1 commit

  • The flush state machine takes in a struct request, which then is
    submitted multiple times to the underling driver. The old block code
    requeses the same request for each of those, so it does not have an
    issue with tapping into the request pool. The new one on the other hand
    allocates a new request for each of the actualy steps of the flush
    sequence. If have already allocated all of the tags for IO, we will
    fail allocating the flush request.

    Set aside a reserved request just for flushes.

    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

25 Oct, 2013

2 commits

  • Add a helper to iterate over all hw queues and stop them. This is useful
    for driver that implement PM suspend functionality.

    Signed-off-by: Christoph Hellwig

    Modified to just call blk_mq_stop_hw_queue() by Jens.

    Signed-off-by: Jens Axboe

    Christoph Hellwig
     
  • Linux currently has two models for block devices:

    - The classic request_fn based approach, where drivers use struct
    request units for IO. The block layer provides various helper
    functionalities to let drivers share code, things like tag
    management, timeout handling, queueing, etc.

    - The "stacked" approach, where a driver squeezes in between the
    block layer and IO submitter. Since this bypasses the IO stack,
    driver generally have to manage everything themselves.

    With drivers being written for new high IOPS devices, the classic
    request_fn based driver doesn't work well enough. The design dates
    back to when both SMP and high IOPS was rare. It has problems with
    scaling to bigger machines, and runs into scaling issues even on
    smaller machines when you have IOPS in the hundreds of thousands
    per device.

    The stacked approach is then most often selected as the model
    for the driver. But this means that everybody has to re-invent
    everything, and along with that we get all the problems again
    that the shared approach solved.

    This commit introduces blk-mq, block multi queue support. The
    design is centered around per-cpu queues for queueing IO, which
    then funnel down into x number of hardware submission queues.
    We might have a 1:1 mapping between the two, or it might be
    an N:M mapping. That all depends on what the hardware supports.

    blk-mq provides various helper functions, which include:

    - Scalable support for request tagging. Most devices need to
    be able to uniquely identify a request both in the driver and
    to the hardware. The tagging uses per-cpu caches for freed
    tags, to enable cache hot reuse.

    - Timeout handling without tracking request on a per-device
    basis. Basically the driver should be able to get a notification,
    if a request happens to fail.

    - Optional support for non 1:1 mappings between issue and
    submission queues. blk-mq can redirect IO completions to the
    desired location.

    - Support for per-request payloads. Drivers almost always need
    to associate a request structure with some driver private
    command structure. Drivers can tell blk-mq this at init time,
    and then any request handed to the driver will have the
    required size of memory associated with it.

    - Support for merging of IO, and plugging. The stacked model
    gets neither of these. Even for high IOPS devices, merging
    sequential IO reduces per-command overhead and thus
    increases bandwidth.

    For now, this is provided as a potential 3rd queueing model, with
    the hope being that, as it matures, it can replace both the classic
    and stacked model. That would get us back to having just 1 real
    model for block devices, leaving the stacked approach to dm/md
    devices (as it was originally intended).

    Contributions in this patch from the following people:

    Shaohua Li
    Alexander Gordeev
    Christoph Hellwig
    Mike Christie
    Matias Bjorling
    Jeff Moyer

    Acked-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Jens Axboe