lkml.org 
[lkml]   [2013]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH v4 0/2] blk-throttle: simplify logic by token bucket algorithm
Date
From: Hong Zhiguo <zhiguohong@tencent.com>

Based on the discussion with Vivek, Tejun and Jens.

Patch 1/2 implements basic token bucket rate limiting for blk-throttle.
Patch 2/2 adjusts some behavior for the cases pointed out by Vivek:
- A huge bio may be allowed immediately after a long time of idle
- When token is trimmed for above case, should not trim ancestors
when bio climbs up, instead, trim ancestors when bio is queued
on lowest child group.

Trimming of iops token is not necessary. Since a bio always costs _one_
iops token. Trimming it won't change the fact that current iops token is
zero or not.

I renamed "last_dispatch" back to "t_c"(Time Checkpoint, naming from network
code) because now it's not only updated when a bio is dispatched. See patch
2/2.

Thanks Vivek for the ancestor over-trim issue and the proposed solution.
I took another method inspired by Vivek's comments but different. Please
help to review it.

Hong Zhiguo (2):
blk-throttle: simplify logic by token bucket algorithm
blk-throttle: trim tokens generated for an idle tree

block/blk-throttle.c | 321 ++++++++++++++-------------------------------------
1 file changed, 87 insertions(+), 234 deletions(-)

--
1.8.1.2



\
 
 \ /
  Last update: 2013-10-20 14:41    [W:0.074 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site