1. 03 6月, 2011 1 次提交
    • J
      iosched: prevent aliased requests from starving other I/O · 796d5116
      Jeff Moyer 提交于
      Hi, Jens,
      
      If you recall, I posted an RFC patch for this back in July of last year:
      http://lkml.org/lkml/2010/7/13/279
      
      The basic problem is that a process can issue a never-ending stream of
      async direct I/Os to the same sector on a device, thus starving out
      other I/O in the system (due to the way the alias handling works in both
      cfq and deadline).  The solution I proposed back then was to start
      dispatching from the fifo after a certain number of aliases had been
      dispatched.  Vivek asked why we had to treat aliases differently at all,
      and I never had a good answer.  So, I put together a simple patch which
      allows aliases to be added to the rb tree (it adds them to the right,
      though that doesn't matter as the order isn't guaranteed anyway).  I
      think this is the preferred solution, as it doesn't break up time slices
      in CFQ or batches in deadline.  I've tested it, and it does solve the
      starvation issue.  Let me know what you think.
      
      Cheers,
      Jeff
      Signed-off-by: NJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      796d5116
  2. 24 5月, 2011 4 次提交
  3. 23 5月, 2011 1 次提交
  4. 21 5月, 2011 4 次提交
    • V
      blk-throttle: Make dispatch stats per cpu · 5624a4e4
      Vivek Goyal 提交于
      Currently we take blkg_stat lock for even updating the stats. So even if
      a group has no throttling rules (common case for root group), we end
      up taking blkg_lock, for updating the stats.
      
      Make dispatch stats per cpu so that these can be updated without taking
      blkg lock.
      
      If cpu goes offline, these stats simply disappear. No protection has
      been provided for that yet. Do we really need anything for that?
      Signed-off-by: NVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      5624a4e4
    • V
      blk-cgroup: Allow sleeping while dynamically allocating a group · f469a7b4
      Vivek Goyal 提交于
      Currently, all the cfq_group or throtl_group allocations happen while
      we are holding ->queue_lock and sleeping is not allowed.
      
      Soon, we will move to per cpu stats and also need to allocate the
      per group stats. As one can not call alloc_percpu() from atomic
      context as it can sleep, we need to drop ->queue_lock, allocate the
      group, retake the lock and continue processing.
      
      In throttling code, I check the queue DEAD flag again to make sure
      that driver did not call blk_cleanup_queue() in the mean time.
      Signed-off-by: NVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      f469a7b4
    • V
      cfq-iosched: Fix a possible race with cfq cgroup removal code · 56edf7d7
      Vivek Goyal 提交于
      blkg->key = cfqd is an rcu protected pointer and hence we used to do
      call_rcu(cfqd->rcu_head) to free up cfqd after one rcu grace period.
      
      The problem here is that even though cfqd is around, there are no
      gurantees that associated request queue (td->queue) or q->queue_lock
      is still around. A driver might have called blk_cleanup_queue() and
      release the lock.
      
      It might happen that after freeing up the lock we call
      blkg->key->queue->queue_ock and crash. This is possible in following
      path.
      
      blkiocg_destroy()
       blkio_unlink_group_fn()
        cfq_unlink_blkio_group()
      
      Hence, wait for an rcu peirod if there are groups which have not
      been unlinked from blkcg->blkg_list. That way, if there are any groups
      which are taking cfq_unlink_blkio_group() path, can safely take queue
      lock.
      
      This is how we have taken care of race in throttling logic also.
      Signed-off-by: NVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      56edf7d7
    • V
      cfq-iosched: Get rid of redundant function parameter "create" · 3e59cf9d
      Vivek Goyal 提交于
      Nobody seems to be using cfq_find_alloc_cfqg() function parameter "create".
      Get rid of that.
      Signed-off-by: NVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      3e59cf9d
  5. 16 5月, 2011 1 次提交
    • V
      blk-throttle: Use task_subsys_state() to determine a task's blkio_cgroup · 70087dc3
      Vivek Goyal 提交于
      Currentlly we first map the task to cgroup and then cgroup to
      blkio_cgroup. There is a more direct way to get to blkio_cgroup
      from task using task_subsys_state(). Use that.
      
      The real reason for the fix is that it also avoids a race in generic
      cgroup code. During remount/umount rebind_subsystems() is called and
      it can do following with and rcu protection.
      
      cgrp->subsys[i] = NULL;
      
      That means if somebody got hold of cgroup under rcu and then it tried
      to do cgroup->subsys[] to get to blkio_cgroup, it would get NULL which
      is wrong. I was running into this race condition with ltp running on a
      upstream derived kernel and that lead to crash.
      
      So ideally we should also fix cgroup generic code to wait for rcu
      grace period before setting pointer to NULL. Li Zefan is not very keen
      on introducing synchronize_wait() as he thinks it will slow
      down moun/remount/umount operations.
      
      So for the time being atleast fix the kernel crash by taking a more
      direct route to blkio_cgroup.
      
      One tester had reported a crash while running LTP on a derived kernel
      and with this fix crash is no more seen while the test has been
      running for over 6 days.
      Signed-off-by: NVivek Goyal <vgoyal@redhat.com>
      Reviewed-by: NLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      70087dc3
  6. 19 4月, 2011 1 次提交
  7. 18 4月, 2011 1 次提交
  8. 31 3月, 2011 1 次提交
  9. 23 3月, 2011 3 次提交
  10. 17 3月, 2011 1 次提交
  11. 12 3月, 2011 1 次提交
  12. 10 3月, 2011 1 次提交
  13. 07 3月, 2011 3 次提交
  14. 02 3月, 2011 2 次提交
    • T
      block: add @force_kblockd to __blk_run_queue() · 1654e741
      Tejun Heo 提交于
      __blk_run_queue() automatically either calls q->request_fn() directly
      or schedules kblockd depending on whether the function is recursed.
      blk-flush implementation needs to be able to explicitly choose
      kblockd.  Add @force_kblockd.
      
      All the current users are converted to specify %false for the
      parameter and this patch doesn't introduce any behavior change.
      
      stable: This is prerequisite for fixing ide oops caused by the new
              blk-flush implementation.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jan Beulich <JBeulich@novell.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: stable@kernel.org
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      1654e741
    • J
      cfq-iosched: Always provide group isolation. · 0bbfeb83
      Justin TerAvest 提交于
      Effectively, make group_isolation=1 the default and remove the tunable.
      The setting group_isolation=0 was because by default we idle on
      sync-noidle tree and on fast devices, this can be very harmful for
      throughput.
      
      However, this problem can also be addressed by tuning slice_idle and
      possibly group_idle on faster storage devices.
      
      This change simplifies the CFQ code by removing the feature entirely.
      Signed-off-by: NJustin TerAvest <teravest@google.com>
      Acked-by: NVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      0bbfeb83
  15. 11 2月, 2011 1 次提交
  16. 09 2月, 2011 1 次提交
    • J
      cfq-iosched: Don't wait if queue already has requests. · 02a8f01b
      Justin TerAvest 提交于
      Commit 7667aa06 added logic to wait for
      the last queue of the group to become busy (have at least one request),
      so that the group does not lose out for not being continuously
      backlogged. The commit did not check for the condition that the last
      queue already has some requests. As a result, if the queue already has
      requests, wait_busy is set. Later on, cfq_select_queue() checks the
      flag, and decides that since the queue has a request now and wait_busy
      is set, the queue is expired.  This results in early expiration of the
      queue.
      
      This patch fixes the problem by adding a check to see if queue already
      has requests. If it does, wait_busy is not set. As a result, time slices
      do not expire early.
      
      The queues with more than one request are usually buffered writers.
      Testing shows improvement in isolation between buffered writers.
      
      Cc: stable@kernel.org
      Signed-off-by: NJustin TerAvest <teravest@google.com>
      Reviewed-by: NGui Jianfeng <guijianfeng@cn.fujitsu.com>
      Acked-by: NVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      02a8f01b
  17. 19 1月, 2011 1 次提交
  18. 14 1月, 2011 2 次提交
  19. 07 1月, 2011 2 次提交
  20. 17 12月, 2010 1 次提交
  21. 13 12月, 2010 1 次提交
  22. 01 12月, 2010 2 次提交
  23. 09 11月, 2010 1 次提交
  24. 08 11月, 2010 3 次提交
    • S
      cfq-iosched: don't idle if a deep seek queue is slow · 8e1ac665
      Shaohua Li 提交于
      If a deep seek queue slowly deliver requests but disk is much faster, idle
      for the queue just wastes disk throughput. If the queue delevers all requests
      before half its slice is used, the patch disable idle for it.
      In my test, application delivers 32 requests one time, the disk can accept
      128 requests at maxium and disk is fast. without the patch, the throughput
      is just around 30m/s, while with it, the speed is about 80m/s. The disk is
      a SSD, but is detected as a rotational disk. I can configure it as SSD, but
      I thought the deep seek queue logic should be fixed too, for example,
      considering a fast raid.
      Signed-off-by: NShaohua Li <shaohua.li@intel.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      8e1ac665
    • S
      cfq-iosched: schedule dispatch for noidle queue · d2d59e18
      Shaohua Li 提交于
      A queue is idle at cfq_dispatch_requests(), but it gets noidle later. Unless
      other task explictly does unplug or all requests are drained, we will not
      deliever requests to the disk even cfq_arm_slice_timer doesn't make the
      queue idle. For example, cfq_should_idle() returns true because of
      service_tree->count == 1, and then other queues are added. Note, I didn't
      see obvious performance impacts so far with the patch, but just thought
      this could be a problem.
      Signed-off-by: NShaohua Li <shaohua.li@intel.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      d2d59e18
    • S
      cfq-iosched: do cleanup · c1e44756
      Shaohua Li 提交于
      Some functions should return boolean.
      Signed-off-by: NShaohua Li <shaohua.li@intel.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      c1e44756