• Vivek Goyal's avatar
    blkio: Recalculate the throttled bio dispatch time upon throttle limit change · fe071437
    Vivek Goyal authored
    o Currently any cgroup throttle limit changes are processed asynchronousy and
      the change does not take affect till a new bio is dispatched from same group.
    
    o It might happen that a user sets a redicuously low limit on throttling.
      Say 1 bytes per second on reads. In such cases simple operations like mount
      a disk can wait for a very long time.
    
    o Once bio is throttled, there is no easy way to come out of that wait even if
      user increases the read limit later.
    
    o This patch fixes it. Now if a user changes the cgroup limits, we recalculate
      the bio dispatch time according to new limits.
    
    o Can't take queueu lock under blkcg_lock, hence after the change I wake
      up the dispatch thread again which recalculates the time. So there are some
      variables being synchronized across two threads without lock and I had to
      make use of barriers. Hoping I have used barriers correctly. Any review of
      memory barrier code especially will help.
    Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
    Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
    fe071437
blk-throttle.c 27.4 KB