1. 01 6月, 2018 5 次提交
  2. 19 1月, 2018 2 次提交
  3. 07 1月, 2018 1 次提交
  4. 26 10月, 2017 2 次提交
  5. 06 10月, 2017 1 次提交
  6. 29 8月, 2017 1 次提交
    • D
      block: fix warning when I/O elevator is changed as request_queue is being removed · e9a823fb
      David Jeffery 提交于
      There is a race between changing I/O elevator and request_queue removal
      which can trigger the warning in kobject_add_internal.  A program can
      use sysfs to request a change of elevator at the same time another task
      is unregistering the request_queue the elevator would be attached to.
      The elevator's kobject will then attempt to be connected to the
      request_queue in the object tree when the request_queue has just been
      removed from sysfs.  This triggers the warning in kobject_add_internal
      as the request_queue no longer has a sysfs directory:
      
      kobject_add_internal failed for iosched (error: -2 parent: queue)
      ------------[ cut here ]------------
      WARNING: CPU: 3 PID: 14075 at lib/kobject.c:244 kobject_add_internal+0x103/0x2d0
      
      To fix this warning, we can check the QUEUE_FLAG_REGISTERED flag when
      changing the elevator and use the request_queue's sysfs_lock to
      serialize between clearing the flag and the elevator testing the flag.
      Signed-off-by: NDavid Jeffery <djeffery@redhat.com>
      Tested-by: NMing Lei <ming.lei@redhat.com>
      Reviewed-by: NMing Lei <ming.lei@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      e9a823fb
  7. 22 6月, 2017 1 次提交
  8. 10 5月, 2017 1 次提交
    • J
      elevator: remove redundant warnings on IO scheduler switch · 340ff321
      Jens Axboe 提交于
      We warn twice for switching to a scheduler, if that switch fails.
      As we also report the failure in the return value to the
      sysfs write, remove the dmesg induced failures.
      
      Keep the failure print for warning to switch to the kconfig
      selected IO scheduler, as we can't report errors for that in
      any other way.
      Signed-off-by: NJens Axboe <axboe@fb.com>
      340ff321
  9. 03 5月, 2017 1 次提交
  10. 02 5月, 2017 1 次提交
  11. 20 4月, 2017 1 次提交
  12. 19 4月, 2017 1 次提交
  13. 07 4月, 2017 2 次提交
  14. 03 3月, 2017 1 次提交
  15. 23 2月, 2017 1 次提交
  16. 14 2月, 2017 1 次提交
  17. 09 2月, 2017 1 次提交
  18. 02 2月, 2017 1 次提交
  19. 01 2月, 2017 1 次提交
  20. 19 1月, 2017 1 次提交
  21. 18 1月, 2017 3 次提交
  22. 10 12月, 2016 1 次提交
  23. 28 10月, 2016 2 次提交
    • C
      block: better op and flags encoding · ef295ecf
      Christoph Hellwig 提交于
      Now that we don't need the common flags to overflow outside the range
      of a 32-bit type we can encode them the same way for both the bio and
      request fields.  This in addition allows us to place the operation
      first (and make some room for more ops while we're at it) and to
      stop having to shift around the operation values.
      
      In addition this allows passing around only one value in the block layer
      instead of two (and eventuall also in the file systems, but we can do
      that later) and thus clean up a lot of code.
      
      Last but not least this allows decreasing the size of the cmd_flags
      field in struct request to 32-bits.  Various functions passing this
      value could also be updated, but I'd like to avoid the churn for now.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      ef295ecf
    • C
      block: split out request-only flags into a new namespace · e8064021
      Christoph Hellwig 提交于
      A lot of the REQ_* flags are only used on struct requests, and only of
      use to the block layer and a few drivers that dig into struct request
      internals.
      
      This patch adds a new req_flags_t rq_flags field to struct request for
      them, and thus dramatically shrinks the number of common requests.  It
      also removes the unfortunate situation where we have to fit the fields
      from the same enum into 32 bits for struct bio and 64 bits for
      struct request.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NShaun Tancheff <shaun.tancheff@seagate.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      e8064021
  24. 16 8月, 2016 1 次提交
  25. 21 7月, 2016 1 次提交
    • T
      block: do not merge requests without consulting with io scheduler · 72ef799b
      Tahsin Erdogan 提交于
      Before merging a bio into an existing request, io scheduler is called to
      get its approval first. However, the requests that come from a plug
      flush may get merged by block layer without consulting with io
      scheduler.
      
      In case of CFQ, this can cause fairness problems. For instance, if a
      request gets merged into a low weight cgroup's request, high weight cgroup
      now will depend on low weight cgroup to get scheduled. If high weigt cgroup
      needs that io request to complete before submitting more requests, then it
      will also lose its timeslice.
      
      Following script demonstrates the problem. Group g1 has a low weight, g2
      and g3 have equal high weights but g2's requests are adjacent to g1's
      requests so they are subject to merging. Due to these merges, g2 gets
      poor disk time allocation.
      
      cat > cfq-merge-repro.sh << "EOF"
      #!/bin/bash
      set -e
      
      IO_ROOT=/mnt-cgroup/io
      
      mkdir -p $IO_ROOT
      
      if ! mount | grep -qw $IO_ROOT; then
        mount -t cgroup none -oblkio $IO_ROOT
      fi
      
      cd $IO_ROOT
      
      for i in g1 g2 g3; do
        if [ -d $i ]; then
          rmdir $i
        fi
      done
      
      mkdir g1 && echo 10 > g1/blkio.weight
      mkdir g2 && echo 495 > g2/blkio.weight
      mkdir g3 && echo 495 > g3/blkio.weight
      
      RUNTIME=10
      
      (echo $BASHPID > g1/cgroup.procs &&
       fio --readonly --name name1 --filename /dev/sdb \
           --rw read --size 64k --bs 64k --time_based \
           --runtime=$RUNTIME --offset=0k &> /dev/null)&
      
      (echo $BASHPID > g2/cgroup.procs &&
       fio --readonly --name name1 --filename /dev/sdb \
           --rw read --size 64k --bs 64k --time_based \
           --runtime=$RUNTIME --offset=64k &> /dev/null)&
      
      (echo $BASHPID > g3/cgroup.procs &&
       fio --readonly --name name1 --filename /dev/sdb \
           --rw read --size 64k --bs 64k --time_based \
           --runtime=$RUNTIME --offset=256k &> /dev/null)&
      
      sleep $((RUNTIME+1))
      
      for i in g1 g2 g3; do
        echo ---- $i ----
        cat $i/blkio.time
      done
      
      EOF
      # ./cfq-merge-repro.sh
      ---- g1 ----
      8:16 162
      ---- g2 ----
      8:16 165
      ---- g3 ----
      8:16 686
      
      After applying the patch:
      
      # ./cfq-merge-repro.sh
      ---- g1 ----
      8:16 90
      ---- g2 ----
      8:16 445
      ---- g3 ----
      8:16 471
      Signed-off-by: NTahsin Erdogan <tahsin@google.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      72ef799b
  26. 08 6月, 2016 1 次提交
  27. 22 10月, 2015 1 次提交
  28. 10 6月, 2015 1 次提交
    • J
      cfq-iosched: fix the setting of IOPS mode on SSDs · 0bb97947
      Jens Axboe 提交于
      A previous commit wanted to make CFQ default to IOPS mode on
      non-rotational storage, however it did so when the queue was
      initialized and the non-rotational flag is only set later on
      in the probe.
      
      Add an elevator hook that gets called off the add_disk() path,
      at that point we know that feature probing has finished, and
      we can reliably check for the various flags that drivers can
      set.
      
      Fixes: 41c0126b ("block: Make CFQ default to IOPS mode on SSDs")
      Tested-by: NRomain Francoise <romain@orebokech.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      0bb97947
  29. 02 6月, 2015 1 次提交
  30. 24 4月, 2015 1 次提交