1. 18 11月, 2008 1 次提交
  2. 06 11月, 2008 4 次提交
    • A
      Block: use round_jiffies_up() · 7838c15b
      Alan Stern 提交于
      This patch (as1159b) changes the timeout routines in the block core to
      use round_jiffies_up().  There's no point in rounding the timer
      deadline down, since if it expires too early we will have to restart
      it.
      
      The patch also removes some unnecessary tests when a request is
      removed from the queue's timer list.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      7838c15b
    • M
      blk: move blk_delete_timer call in end_that_request_last · e78042e5
      Mike Anderson 提交于
      Move the calling  blk_delete_timer to later in end_that_request_last to
      address an issue where blkdev_dequeue_request may have add a timer for the
      request.
      Signed-off-by: NMike Anderson <andmike@linux.vnet.ibm.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      e78042e5
    • T
      block: add timer on blkdev_dequeue_request() not elv_next_request() · 2920ebbd
      Tejun Heo 提交于
      Block queue supports two usage models - one where block driver peeks
      at the front of queue using elv_next_request(), processes it and
      finishes it and the other where block driver peeks at the front of
      queue, dequeue the request using blkdev_dequeue_request() and finishes
      it.  The latter is more flexible as it allows the driver to process
      multiple commands concurrently.
      
      These two inconsistent usage models affect the block layer
      implementation confusing.  For some, elv_next_request() is considered
      the issue point while others consider blkdev_dequeue_request() the
      issue point.
      
      Till now the inconsistency mostly affect only accounting, so it didn't
      really break anything seriously; however, with block layer timeout,
      this inconsistency hits hard.  Block layer considers
      elv_next_request() the issue point and adds timer but SCSI layer
      thinks it was just peeking and when the request can't process the
      command right away, it's just left there without further processing.
      This makes the request dangling on the timer list and, when the timer
      goes off, the request which the SCSI layer and below think is still on
      the block queue ends up in the EH queue, causing various problems - EH
      hang (failed count goes over busy count and EH never wakes up),
      WARN_ON() and oopses as low level driver trying to handle the unknown
      command, etc. depending on the timing.
      
      As SCSI midlayer is the only user of block layer timer at the moment,
      moving blk_add_timer() to elv_dequeue_request() fixes the problem;
      however, this two usage models definitely need to be cleaned up in the
      future.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      2920ebbd
    • F
      43381785
  3. 24 10月, 2008 1 次提交
  4. 23 10月, 2008 2 次提交
  5. 21 10月, 2008 12 次提交
  6. 17 10月, 2008 8 次提交
  7. 13 10月, 2008 1 次提交
    • M
      [SCSI] block: separate failfast into multiple bits. · 6000a368
      Mike Christie 提交于
      Multipath is best at handling transport errors. If it gets a device
      error then there is not much the multipath layer can do. It will just
      access the same device but from a different path.
      
      This patch breaks up failfast into device, transport and driver errors.
      The multipath layers (md and dm mutlipath) only ask the lower levels to
      fast fail transport errors. The user of failfast, read ahead, will ask
      to fast fail on all errors.
      
      Note that blk_noretry_request will return true if any failfast bit
      is set. This allows drivers that do not support the multipath failfast
      bits to continue to fail on any failfast error like before. Drivers
      like scsi that are able to fail fast specific errors can check
      for the specific fail fast type. In the next patch I will convert
      scsi.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      6000a368
  8. 09 10月, 2008 11 次提交
    • M
      block: Switch blk_integrity_compare from bdev to gendisk · ad7fce93
      Martin K. Petersen 提交于
      The DM and MD integrity support now depends on being able to use
      gendisks instead of block_devices when comparing integrity profiles.
      Change function parameters accordingly.
      
      Also update comparison logic so that two NULL profiles are a valid
      configuration.
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      ad7fce93
    • M
      block: Fix double put in blk_integrity_unregister · 0c032ab8
      Martin K. Petersen 提交于
      - kobject_del already puts the parent.
      
       - Set integrity profile to NULL to prevent stale data.
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      0c032ab8
    • K
      block: remove end_{queued|dequeued}_request() · d00e29fd
      Kiyoshi Ueda 提交于
      This patch removes end_queued_request() and end_dequeued_request(),
      which are no longer used.
      
      As a results, users of __end_request() became only end_request().
      So the actual code in __end_request() is moved to end_request()
      and __end_request() is removed.
      Signed-off-by: NKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: NJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      d00e29fd
    • K
      block: change elevator to use __blk_end_request() · 99cd3386
      Kiyoshi Ueda 提交于
      This patch converts elevator to use __blk_end_request() directly
      so that end_{queued|dequeued}_request() can be removed.
      Related 'uptodate' arguments is converted to 'error'.
      Signed-off-by: NKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: NJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      99cd3386
    • J
      blktrace: use BLKTRACE_BDEV_SIZE as the name size for setup structure · 0497b345
      Jens Axboe 提交于
      Define as 32, which is is what BDEVNAME_SIZE is/was as well. This keeps
      the user interface the same and gets rid of the difference between
      kernel and user api here.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      0497b345
    • K
      block: add lld busy state exporting interface · ef9e3fac
      Kiyoshi Ueda 提交于
      This patch adds an new interface, blk_lld_busy(), to check lld's
      busy state from the block layer.
      blk_lld_busy() calls down into low-level drivers for the checking
      if the drivers set q->lld_busy_fn() using blk_queue_lld_busy().
      
      This resolves a performance problem on request stacking devices below.
      
      Some drivers like scsi mid layer stop dispatching request when
      they detect busy state on its low-level device like host/target/device.
      It allows other requests to stay in the I/O scheduler's queue
      for a chance of merging.
      
      Request stacking drivers like request-based dm should follow
      the same logic.
      However, there is no generic interface for the stacked device
      to check if the underlying device(s) are busy.
      If the request stacking driver dispatches and submits requests to
      the busy underlying device, the requests will stay in
      the underlying device's queue without a chance of merging.
      This causes performance problem on burst I/O load.
      
      With this patch, busy state of the underlying device is exported
      via q->lld_busy_fn().  So the request stacking driver can check it
      and stop dispatching requests if busy.
      
      The underlying device driver must return the busy state appropriately:
          1: when the device driver can't process requests immediately.
          0: when the device driver can process requests immediately,
             including abnormal situations where the device driver needs
             to kill all requests.
      Signed-off-by: NKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: NJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      ef9e3fac
    • E
      block: Fix blk_start_queueing() to not kick a stopped queue · 336c3d8c
      Elias Oltmanns 提交于
      blk_start_queueing() should act like the generic queue unplugging
      and kicking and ignore a stopped queue. Such a queue may not be
      run until after a call to blk_start_queue().
      Signed-off-by: NElias Oltmanns <eo@nebensachen.de>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      336c3d8c
    • J
      block: reserve some tags just for sync IO · e3ba9ae5
      Jens Axboe 提交于
      By only allowing async IO to consume 3/4 ths of the tag depth, we
      always have slots free to serve sync IO. This is important to avoid
      having writes fill the entire tag queue, thus starving reads.
      
      Original patch and idea from Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      e3ba9ae5
    • J
      block: as/cfq ssd idle check update · f7d7b7a7
      Jens Axboe 提交于
      We really need to know about the hardware tagging support as well,
      since if the SSD does not do tagging then we still want to idle.
      Otherwise have the same dependent sync IO vs flooding async IO
      problem as on rotational media.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      f7d7b7a7
    • J
      block: add queue flag for SSD/non-rotational devices · a68bbddb
      Jens Axboe 提交于
      We don't want to idle in AS/CFQ if the device doesn't have a seek
      penalty. So add a QUEUE_FLAG_NONROT to indicate a non-rotational
      device, low level drivers should set this flag upon discovery of
      an SSD or similar device type.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      a68bbddb
    • K
      block: add a queue flag for request stacking support · 4ee5eaf4
      Kiyoshi Ueda 提交于
      This patch adds a queue flag to indicate the block device can be
      used for request stacking.
      
      Request stacking drivers need to stack their devices on top of
      only devices of which q->request_fn is functional.
      Since bio stacking drivers (e.g. md, loop) basically initialize
      their queue using blk_alloc_queue() and don't set q->request_fn,
      the check of (q->request_fn == NULL) looks enough for that purpose.
      
      However, dm will become both types of stacking driver (bio-based and
      request-based).  And dm will always set q->request_fn even if the dm
      device is bio-based of which q->request_fn is not functional actually.
      So we need something else to distinguish the type of the device.
      Adding a queue flag is a solution for that.
      
      The reason why dm always sets q->request_fn is to keep
      the compatibility of dm user-space tools.
      Currently, all dm user-space tools are using bio-based dm without
      specifying the type of the dm device they use.
      To use request-based dm without changing such tools, the kernel
      must decide the type of the dm device automatically.
      The automatic type decision can't be done at the device creation time
      and needs to be deferred until such tools load a mapping table,
      since the actual type is decided by dm target type included in
      the mapping table.
      
      So a dm device has to be initialized using blk_init_queue()
      so that we can load either type of table.
      Then, all queue stuffs are set (e.g. q->request_fn) and we have
      no element to distinguish that it is bio-based or request-based,
      even after a table is loaded and the type of the device is decided.
      
      By the way, some stuffs of the queue (e.g. request_list, elevator)
      are needless when the dm device is used as bio-based.
      But the memory size is not so large (about 20[KB] per queue on ia64),
      so I hope the memory loss can be acceptable for bio-based dm users.
      Signed-off-by: NKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: NJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      4ee5eaf4