On Tue 16 Feb 2016 11:45:32 AM CET, Kevin Wolf <kw...@redhat.com> wrote:
>> + /* If the bucket is not full yet we have to make sure that we >> + * fulfill the goal of bkt->max units per second. */ >> + if (bkt->burst_length > 1) { >> + /* We use 1/10 of the max value to smooth the throttling. >> + * See throttle_fix_bucket() for more details. */ >> + extra = bkt->burst_level - bkt->max / 10; > > I don't understand the connection between throttle_fix_bucket() and > this. > > throttle_fix_bucket() seems to set a default rate for bursts, which > kind of makes sense to me (but what's the point when this is lower > than the average rate?) The point is to smoothen the throttling: if you request a max rate of 2000 operations per second, what you actually get is a rate of 200 operations per tenth of a second. With the current code, if you set bkg->avg to 1000 but not bkt->max you'll get exactly this. I'm just applying the same logic to bursts. Berto