Cake - FQ_codel the next generation
 help / color / mirror / Atom feed
From: Jonathan Morton <chromatix99@gmail.com>
To: xnor <xnoreq@gmail.com>
Cc: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>,
	George Amanakis <g_amanakis@yahoo.com>,
	cake@lists.bufferbloat.net
Subject: Re: [Cake] Choosing a tin to work on
Date: Wed, 12 Apr 2017 16:44:21 +0300	[thread overview]
Message-ID: <228FEE75-471C-4F92-9176-62F8A8A71E9C@gmail.com> (raw)
In-Reply-To: <em4f3d2347-f768-4a28-ad1e-5f44b9637d59@gaming>


> On 12 Apr, 2017, at 15:48, xnor <xnoreq@gmail.com> wrote:
> 
> Hey,
> 
>>>                s64 tdiff = b->tin_time_next_packet - now;
>>>                if(tdiff <= 0 || tdiff <= best_time) {
>>>                    best_time = tdiff;
>>>                    best_tin = tin;
>>>                }
>> 
>> I'll try to answer this based on a vague bit of understanding...and then Jonathan can shoot me down as well :-)
>> 
>> So the 'best_time' is signed because we can have a packet in a tin that is not yet due to be sent (a positive result...ie. we have got here early) and/or we can have a tin that is due now/overdue (a zero/negative result, we've got here late)
>> 
>> The complication is that we can have multiple tins overdue, so we want the highest priority *and* least overdue (least late) tin - this is the reason for searching in tin_order[oi] and as a result tdiff can be <=0 and bigger than best_time.
>> 
>> best_time is initialised to the 'most early' time possible.
> that makes no sense to me.
> 
> best_time is initialized to some high value (though why is it not 0x7FFF FFFF FFFF FFFFL, the highest possible positive s64?) such that no matter how far tdiff is in the future, best_time will always be set to the lower tdiff.
> (Just like you would initialize a variable keeping track of the max to the lowest possible value, you set a min variable to the highest possible value.)
> 
> But if you wanted best_time to end up as the lowest value, then you would have to only set it if tdiff < best_time (or <= if you actually want to prefer the last tin if they happen to have the same tdiff), and not also if tdiff <= 0.
> 
> For example, if tdiff values were 5000, -5000, 0 then best_time would be set to 0. The last value less than or equal to zero will always win as best_tin.
> If all tdiff values are positive then best_time will end up as the lowest value however.

For some reason I never seem to have got the initial question post.  The two of you are broadly right though.

The intention here is:

- Find the highest-priority tin with a packet already due;
- If none are due yet, find the one with a packet due soonest.

This should have the same type of “soft priority” behaviour as the previous WRR version, but I was hoping it could reduce the latency for processing sparse low-latency tins while under steady bulk load.

 - Jonathan Morton


  reply	other threads:[~2017-04-12 13:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1698783902.612018.1491919195146.ref@mail.yahoo.com>
2017-04-11 13:59 ` George Amanakis
2017-04-11 14:11   ` [Cake] Fw: " George Amanakis
2017-04-12  9:15   ` [Cake] " Kevin Darbyshire-Bryant
2017-04-12 12:48     ` xnor
2017-04-12 13:44       ` Jonathan Morton [this message]
2017-04-12 14:02         ` George Amanakis
2017-04-12 13:45       ` George Amanakis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=228FEE75-471C-4F92-9176-62F8A8A71E9C@gmail.com \
    --to=chromatix99@gmail.com \
    --cc=cake@lists.bufferbloat.net \
    --cc=g_amanakis@yahoo.com \
    --cc=kevin@darbyshire-bryant.me.uk \
    --cc=xnoreq@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox