Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Re: HFSC
Date: Sun, 21 Mar 2004 21:07:59 +0000	[thread overview]
Message-ID: <405E042F.5050807@trash.net> (raw)
In-Reply-To: <873c8v3vbk.fsf@iki.fi>

Nuutti Kotivuori wrote:
> Patrick McHardy wrote:
>
> BTW the Blue scheduler patch for 2.6 seems to be working nicely - but
> I haven't had the time to run the tests on it that I wished to, so I
> haven't posted anything further about it.

I have in the mean time read up on SFB, maybe I'll extend blue when I
find the time.

>>Adding n curves gives you (in the worst case) a (n+1)-ary curve, you
>>can calculate it like this:
>>
>>sc1: m1 = 100kbit, d = 1s, m2 = 200kbit
>>sc2: m1 = 50kbit, d = 0.25s, m2 = 300kbit
>>sc3: m1 = 200kbit, d = 1.5s, m2 = 500kbit
>>-----------------------------------------
>>m >>{
>>	350kbit		d <= 0.25s
>>	600kbit		0.25s < d <= 1s
>>	700kbit		1s < d <= 1.5s
>>	1000kbit	d > 1.5s
>>}
> 
> 
> Right. I think there's a need for a small tool to make these
> calculations - and perhaps even to automatically be able to scale
> other curves to maintain the restrictions. But that is for the future,
> manual calculation will do for now.

Yes that would certainly be better.

>>>I also seem to have a lot of difficulties in trying to simulate the
>>>behaviour of the qdisc.
> 
> [...]
> 
>>Have you applied the patches from trash.net/~kaber/hfsc/tcsim ?
>>With HZ\x1000 and PSCHED_GETTIMEOFDAY as clocksource I got very
>>good results.
> 
> 
> I tried HZ\x1000 and HZ\x100 both, and the results were odd. But I think
> I didn't touch the clocksource at all. I will try later on with
> PSCHED_GETTIMEOFDAY as well.

PSCHED_GETTIMEOFDAY (or PSCHED_CPU in case of the kernel) are important
for HFSC to work properly, PSCHED_JIFFIES has too low resolution.

>>Works ok here .. do you mean inside tcsim ? 
> 
> No, I don't mean inside tcsim. Here is a full transcript:
> 
> *****
> shiro:~# export DEV=lo
> shiro:~# tc -s -d qdisc show dev $DEV
> shiro:~# ping localhost -c 4
> PING shiro.i.naked.iki.fi (127.0.0.1) 56(84) bytes of data.
> 64 bytes from shiro.i.naked.iki.fi (127.0.0.1): icmp_seq=1 ttld time=0.062 ms
> 64 bytes from shiro.i.naked.iki.fi (127.0.0.1): icmp_seq=2 ttld time=0.059 ms
> 64 bytes from shiro.i.naked.iki.fi (127.0.0.1): icmp_seq=3 ttld time=0.059 ms
> 64 bytes from shiro.i.naked.iki.fi (127.0.0.1): icmp_seq=4 ttld time=0.060 ms
> 
> --- shiro.i.naked.iki.fi ping statistics ---
> 4 packets transmitted, 4 received, 0% packet loss, time 2999ms
> rtt min/avg/max/mdev = 0.059/0.060/0.062/0.001 ms
> 
> shiro:~# tc qdisc add dev $DEV root handle 1: hfsc default 1
> shiro:~# tc class add dev $DEV parent 1: classid 1:1 hfsc rt m2 100kbps
> shiro:~# ping localhost -c 4
> PING shiro.i.naked.iki.fi (127.0.0.1) 56(84) bytes of data.
> ^C
> --- shiro.i.naked.iki.fi ping statistics ---
> 0 packets transmitted, 0 received
> 
> shiro:~# tc -s -d qdisc show dev $DEV
> qdisc hfsc 1: default 1 
>  Sent 0 bytes 0 pkts (dropped 17, overlimits 0) 
> 
> shiro:~# tc -s -d class show dev $DEV
> class hfsc 1: root 
>  Sent 0 bytes 0 pkts (dropped 0, overlimits 0) 
>  period 0 level 1 
> 
> class hfsc 1:1 parent 1: rt m1 0bps d 0us m2 800Kbit 
>  Sent 0 bytes 0 pkts (dropped 17, overlimits 0) 
>  period 0 level 0 
> 
> shiro:~# tc qdisc del dev $DEV root
> shiro:~# ping localhost -c 4
> PING shiro.i.naked.iki.fi (127.0.0.1) 56(84) bytes of data.
> 64 bytes from shiro.i.naked.iki.fi (127.0.0.1): icmp_seq=1 ttld time=0.060 ms
> 64 bytes from shiro.i.naked.iki.fi (127.0.0.1): icmp_seq=2 ttld time=0.060 ms
> 64 bytes from shiro.i.naked.iki.fi (127.0.0.1): icmp_seq=3 ttld time=0.057 ms
> 64 bytes from shiro.i.naked.iki.fi (127.0.0.1): icmp_seq=4 ttld time=0.059 ms
> 
> --- shiro.i.naked.iki.fi ping statistics ---
> 4 packets transmitted, 4 received, 0% packet loss, time 2999ms
> rtt min/avg/max/mdev = 0.057/0.059/0.060/0.001 ms
> 
> shiro:~# uname -a
> Linux shiro 2.6.3-shiro-1 #1 Sat Mar 6 21:03:38 EET 2004 i686 GNU/Linux
> *****
> 
> So, I don't know what's up with that. I will debug further.

I know what the problem is. Try: ip link set lo txqueuelen 1
or upgrade to 2.6.4. The problem got introduces when fixing
an off-by-one in pfifo_fast, before it would enqueue one packet
with a txqueuelen of 0. In 2.6.4 this behaviour is restored,
although it's a misconfiguration anyway to use leaf-queues with
a limit of 1 for anything but well-formed flows.

> 
> Anyhow, I will try now to come up with a working setup of HFSC for my
> personal use, and in the process I will try to document a sane method
> for coming up with the service curves and setting up the whole thing.
> 
> If that works out, more comprehensive documentation can come later.

Great, I'm looking forward to it.

Regards
Patrick


> 
> This has been very helpful, thank you!
> 
> -- Naked
> 

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

  parent reply	other threads:[~2004-03-21 21:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-28 18:36 [LARTC] Re: HFSC Nuutti Kotivuori
2004-03-01  4:06 ` Patrick McHardy
2004-03-01 12:27 ` syrius.ml
2004-03-01 19:58 ` Nuutti Kotivuori
2004-03-21 17:37 ` Patrick McHardy
2004-03-21 20:38 ` Nuutti Kotivuori
2004-03-21 21:07 ` Patrick McHardy [this message]
2004-03-21 21:33 ` Nuutti Kotivuori

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

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

  git send-email \
    --in-reply-to=405E042F.5050807@trash.net \
    --to=kaber@trash.net \
    --cc=lartc@vger.kernel.org \
    /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