1. 08 3月, 2011 1 次提交
    • V
      blk-throttle: process limit change only through one function · 231d704b
      Vivek Goyal 提交于
      With the help of cgroup interface one can go and upate the bps/iops
      limits of existing group. Once the limits are udpated, a thread is
      woken up to see if some blocked group needs recalculation based on new
      limits and needs to be requeued.
      
      There was also a piece of code where I was checking for group limit
      update when a fresh bio comes in. This patch gets rid of that piece of
      code and keeps processing the limit change at one place
      throtl_process_limit_change().  It just keeps the code simple and easy
      to understand.
      Signed-off-by: NVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      231d704b
  2. 07 3月, 2011 4 次提交
  3. 05 3月, 2011 1 次提交
    • T
      Merge branch 'for-linus' of ../linux-2.6-block into block-for-2.6.39/core · e83a46bb
      Tejun Heo 提交于
      This merge creates two set of conflicts.  One is simple context
      conflicts caused by removal of throtl_scheduled_delayed_work() in
      for-linus and removal of throtl_shutdown_timer_wq() in
      for-2.6.39/core.
      
      The other is caused by commit 255bb490 (block: blk-flush shouldn't
      call directly into q->request_fn() __blk_run_queue()) in for-linus
      crashing with FLUSH reimplementation in for-2.6.39/core.  The conflict
      isn't trivial but the resolution is straight-forward.
      
      * __blk_run_queue() calls in flush_end_io() and flush_data_end_io()
        should be called with @force_kblockd set to %true.
      
      * elv_insert() in blk_kick_flush() should use
        %ELEVATOR_INSERT_REQUEUE.
      
      Both changes are to avoid invoking ->request_fn() directly from
      request completion path and closely match the changes in the commit
      255bb490.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      e83a46bb
  4. 04 3月, 2011 1 次提交
  5. 03 3月, 2011 5 次提交
    • T
      blktrace: Remove blk_fill_rwbs_rq. · 2d3a8497
      Tao Ma 提交于
      If we enable trace events to trace block actions, We use
      blk_fill_rwbs_rq to analyze the corresponding actions
      in request's cmd_flags, but we only choose the minor 2 bits
      from it, so most of other flags(e.g, REQ_SYNC) are missing.
      For example, with a sync write we get:
      write_test-2409  [001]   160.013869: block_rq_insert: 3,64 W 0 () 258135 + =
      8 [write_test]
      
      Since now we have integrated the flags of both bio and request,
      it is safe to pass rq->cmd_flags directly to blk_fill_rwbs and
      blk_fill_rwbs_rq isn't needed any more.
      
      With this patch, after a sync write we get:
      write_test-2417  [000]   226.603878: block_rq_insert: 3,64 WS 0 () 258135 +=
       8 [write_test]
      Signed-off-by: NTao Ma <boyu.mt@taobao.com>
      Acked-by: NJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      2d3a8497
    • V
      block: Move blk_throtl_exit() call to blk_cleanup_queue() · da527770
      Vivek Goyal 提交于
      Move blk_throtl_exit() in blk_cleanup_queue() as blk_throtl_exit() is
      written in such a way that it needs queue lock. In blk_release_queue()
      there is no gurantee that ->queue_lock is still around.
      
      Initially blk_throtl_exit() was in blk_cleanup_queue() but Ingo reported
      one problem.
      
        https://lkml.org/lkml/2010/10/23/86
      
        And a quick fix moved blk_throtl_exit() to blk_release_queue().
      
              commit 7ad58c02
              Author: Jens Axboe <jaxboe@fusionio.com>
              Date:   Sat Oct 23 20:40:26 2010 +0200
      
              block: fix use-after-free bug in blk throttle code
      
      This patch reverts above change and does not try to shutdown the
      throtl work in blk_sync_queue(). By avoiding call to
      throtl_shutdown_timer_wq() from blk_sync_queue(), we should also avoid
      the problem reported by Ingo.
      
      blk_sync_queue() seems to be used only by md driver and it seems to be
      using it to make sure q->unplug_fn is not called as md registers its
      own unplug functions and it is about to free up the data structures
      used by unplug_fn(). Block throttle does not call back into unplug_fn()
      or into md. So there is no need to cancel blk throttle work.
      
      In fact I think cancelling block throttle work is bad because it might
      happen that some bios are throttled and scheduled to be dispatched later
      with the help of pending work and if work is cancelled, these bios might
      never be dispatched.
      
      Block layer also uses blk_sync_queue() during blk_cleanup_queue() and
      blk_release_queue() time. That should be safe as we are also calling
      blk_throtl_exit() which should make sure all the throttling related
      data structures are cleaned up.
      Signed-off-by: NVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      da527770
    • V
      loop: No need to initialize ->queue_lock explicitly before calling blk_cleanup_queue() · cd25f549
      Vivek Goyal 提交于
      Now we initialize ->queue_lock at queue allocation time so driver does
      not have to worry about initializing it before calling
      blk_cleanup_queue().
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      cd25f549
    • V
      block: Initialize ->queue_lock to internal lock at queue allocation time · c94a96ac
      Vivek Goyal 提交于
      There does not seem to be a clear convention whether q->queue_lock is
      initialized or not when blk_cleanup_queue() is called. In the past it
      was not necessary but now blk_throtl_exit() takes up queue lock by
      default and needs queue lock to be available.
      
      In fact elevator_exit() code also has similar requirement just that it
      is less stringent in the sense that elevator_exit() is called only if
      elevator is initialized.
      
      Two problems have been noticed because of ambiguity about spin lock
      status.
      
            - If a driver calls blk_alloc_queue() and then soon calls
              blk_cleanup_queue() almost immediately, (because some other
      	driver structure allocation failed or some other error happened)
      	then blk_throtl_exit() will run into issues as queue lock is not
      	initialized. Loop driver ran into this issue recently and I
      	noticed error paths in md driver too. Similar error paths should
      	exist in other drivers too.
      
            - If some driver provided external spin lock and zapped the lock
              before blk_cleanup_queue(), then it can lead to issues.
      
      So this patch initializes the default queue lock at queue allocation time.
      
      block throttling code is one of the users of queue lock and it is
      initialized at the queue allocation time, so it makes sense to
      initialize ->queue_lock also to internal lock. A driver can overide that
      lock later. This will take care of the issue where a driver does not have
      to worry about initializing the queue lock to default before calling
      blk_cleanup_queue()
      Signed-off-by: NVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      c94a96ac
    • L
      block/genhd: Change some numerals into macros · 53f22956
      Liu Yuan 提交于
      Rename the numerals in the diskstats_show() into the macros.
      
      Cc: Jens Axboe <axboe@kernel.dk>
      Signed-off-by: NLiu Yuan <tailai.ly@taobao.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      53f22956
  6. 02 3月, 2011 6 次提交
  7. 01 3月, 2011 10 次提交
  8. 28 2月, 2011 6 次提交
  9. 27 2月, 2011 2 次提交
  10. 26 2月, 2011 4 次提交