Cake - FQ_codel the next generation
 help / color / mirror / Atom feed
From: George Amanakis <g_amanakis@yahoo.com>
To: Jonathan Morton <chromatix99@gmail.com>, cake@lists.bufferbloat.net
Subject: Re: [Cake] total download rate with many flows
Date: Sat, 11 Nov 2017 22:48:56 -0500	[thread overview]
Message-ID: <3cfb7852-ac1f-9274-a10e-2d8c6981922f@yahoo.com> (raw)
In-Reply-To: <CAJq5cE0r24p6aBjf9dtDZqTT0ZNSOZFREHN0aSAbBCrLZSDsrw@mail.gmail.com>

I totally understand what you are saying. However, I believe cake's 
egress and ingress modes currently behave as two extremes. One could 
argue that neither of them is the golden mean. With a patch in ingress 
mode (see below) and a single host using 32 flows to download I managed 
to increase throughput from ~7Mbps to ~10Mbps (configured limit 
12200kbps) while latency increased from ~10ms to ~50ms, which would 
still be acceptable. As a comparison egress mode in the same setup gives 
me throughput ~11.5Mbps and latency ~500ms.

I would like to hear your thoughts about this idea: the patch is 
incrementing q->time_next_packet for dropped packets differently than 
for passed-through ones. Please focus on the idea, not the actual 
implementation :) (also pasted in https://pastebin.com/SZ14WiYw)

=============8<=============

diff --git a/sch_cake.c b/sch_cake.c
index 82f264f..a3a4a88 100644
--- a/sch_cake.c
+++ b/sch_cake.c
@@ -769,6 +769,7 @@ static void cake_heapify_up(struct cake_sched_data 
*q, u16 i)
  }

  static void cake_advance_shaper(struct cake_sched_data *q, struct 
cake_tin_data *b, u32 len, u64 now);
+static void cake_advance_shaper2(struct cake_sched_data *q, struct 
cake_tin_data *b, u32 len, u64 now);

  #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
  static unsigned int cake_drop(struct Qdisc *sch)
@@ -1274,7 +1275,7 @@ retry:
                 /* drop this packet, get another one */
                 if(q->rate_flags & CAKE_FLAG_INGRESS) {
                         len = cake_overhead(q, qdisc_pkt_len(skb));
-                       cake_advance_shaper(q, b, len, now);
+                       cake_advance_shaper2(q, b, len, now);
                         flow->deficit -= len;
                         b->tin_deficit -= len;
                 }
@@ -1286,8 +1287,6 @@ retry:
                 qdisc_qstats_drop(sch);
                 kfree_skb(skb);
  #endif
-               if(q->rate_flags & CAKE_FLAG_INGRESS)
-                       goto retry;
         }

         b->tin_ecn_mark += !!flow->cvars.ecn_marked;
@@ -1351,6 +1350,24 @@ static void cake_advance_shaper(struct 
cake_sched_data *q, struct cake_tin_data
         }
  }

+static void cake_advance_shaper2(struct cake_sched_data *q, struct 
cake_tin_data *b, u32 len, u64 now)
+{
+       /* charge packet bandwidth to this tin, lower tins,
+        * and to the global shaper.
+        */
+       if(q->rate_ns) {
+               s64 tdiff1 = b->tin_time_next_packet - now;
+               s64 tdiff2 = (len * (u64)b->tin_rate_ns) >> 
b->tin_rate_shft;
+               s64 tdiff3 = (len * (u64)q->rate_ns) >> q->rate_shft;
+
+               if(tdiff1 < 0)
+                       b->tin_time_next_packet += tdiff2;
+               else if(tdiff1 < tdiff2)
+                       b->tin_time_next_packet = now + tdiff2;
+
+               q->time_next_packet += (tdiff3*27)>>5;
+       }
+}
  static void cake_reset(struct Qdisc *sch)
  {
         u32 c;

=============8<=============

On 11/10/2017 4:50 PM, Jonathan Morton wrote:
>
> In fact, that's why I put a failsafe into ingress mode, so that it 
> would never stall completely.  It can happen, however, that throughput 
> is significantly reduced when the drop rate is high.
>
> If throughput is more important to you than induced latency, switch to 
> egress mode.
>
> Unfortunately it's not possible to guarantee both low latency and high 
> throughput when operating downstream of the bottleneck link.  ECN 
> gives you better results, though.
>
> - Jonathan Morton
>


  reply	other threads:[~2017-11-12  3:49 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.905.1509489461.3609.cake@lists.bufferbloat.net>
2017-11-01  0:44 ` Dave Taht
2017-11-01  1:06   ` Antoine Deschênes
2017-11-01  1:41     ` George Amanakis
2017-11-01  3:37     ` George Amanakis
     [not found]     ` <mailman.907.1509507446.3609.cake@lists.bufferbloat.net>
2017-11-01 22:01       ` Dave Taht
2017-11-10 16:32         ` George Amanakis
     [not found]         ` <mailman.964.1510331572.3609.cake@lists.bufferbloat.net>
2017-11-10 20:42           ` Dave Taht
2017-11-10 20:54             ` George Amanakis
     [not found]             ` <mailman.968.1510347301.3609.cake@lists.bufferbloat.net>
     [not found]               ` <CAJq5cE0fsOUZid7peQQYE5qwqBr9GNCx_hYE7dWs4F4UTS=RTA@mail.gmail.com>
2017-11-10 21:50                 ` Jonathan Morton
2017-11-12  3:48                   ` George Amanakis [this message]
2017-11-14  1:51                     ` George Amanakis
2017-11-14  1:53                       ` George Amanakis
     [not found]                   ` <mailman.969.1510458543.3609.cake@lists.bufferbloat.net>
2017-11-14  2:08                     ` David Lang
2017-11-14  2:49                       ` George Amanakis
     [not found]                       ` <mailman.986.1510627800.3609.cake@lists.bufferbloat.net>
2017-11-14 20:11                         ` Dave Taht
2017-11-14 22:13                           ` G. Amanakis
     [not found]                           ` <mailman.987.1510697602.3609.cake@lists.bufferbloat.net>
2017-11-14 22:23                             ` Dave Taht
2017-11-15  4:04                               ` George Amanakis
2017-11-16  4:49                                 ` Dave Taht
2017-11-16  6:52                                   ` Jonathan Morton
     [not found]                                     ` <CACvFP_jGkByNCk=-n4NOxptw59nb8Bsup4Ymd+LbGi6O_WJr5Q@mail.gmail.com>
2017-11-16 17:08                                       ` [Cake] Fwd: " Georgios Amanakis
2017-11-16 23:12                                       ` [Cake] " Jonathan Morton
     [not found] <mailman.1036.1510936271.3609.cake@lists.bufferbloat.net>
2017-11-17 20:05 ` Pete Heist
2017-11-20  8:06   ` Jonathan Morton
2017-11-20  9:07     ` Pete Heist

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=3cfb7852-ac1f-9274-a10e-2d8c6981922f@yahoo.com \
    --to=g_amanakis@yahoo.com \
    --cc=cake@lists.bufferbloat.net \
    --cc=chromatix99@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