From: David Miller <davem@davemloft.net>
To: gerrit@erg.abdn.ac.uk
Cc: leandroal@gmail.com, acme@redhat.com, ian.mcdonald@jandi.co.nz,
dccp@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [RFC] dccp ccid-3: High-res or low-res timers?
Date: Sun, 16 Nov 2008 22:48:34 -0800 (PST) [thread overview]
Message-ID: <20081116.224834.166724077.davem@davemloft.net> (raw)
In-Reply-To: <20081115105042.GA7798@gerrit.erg.abdn.ac.uk>
From: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Date: Sat, 15 Nov 2008 11:50:42 +0100
> 1. Handling unavoidable waiting times
> -------------------------------------
> One can not expect that, if the scheduling clock says 'send in x
> microseconds', a packet will indeed leave after x microseconds; due to
> waiting times. An example is in net/dccp/timer.c, when the socket is
> currently locked - we wait for a "small" amount of time:
>
> bh_lock_sock(sk);
> if (sock_owned_by_user(sk))
> sk_reset_timer(sk, &dp->dccps_xmit_timer, jiffies + 1);
> else
> dccp_write_xmit(sk, 0);
> bh_unlock_sock(sk);
This should not happen often enough to be statistically meaningful.
If it does we have serious lock contention and we should fix that.
> 2. Dependency on high-resolution timers
> ---------------------------------------
> Committing the CCID-3/CCID-4 implementations to using high-resolution
> timers means that the modules can not be built/loaded when the kernel
> does not offer sufficient resolution.
>
> This has recently made it hard for someone using CCID-3 to find out
> why DCCP would not run, where the cause was that high-resolution timers
> were not enabled in the kernel.
This could be argued as a bug in the hrtimer interface. What it should
do is let you use the interfaces always, and the kernel gives you as
fine a resolution as the current configuration supports.
> 3. Noise in the output
> ----------------------
> When tracking the speed of a car every 10 seconds, there is a lot of variation
> in the values, due to stopping at traffic lights, accelerating etc. But when
> considering a larger timescale, one can say that the average speed from city
> A to city B was xx mph, since the whole journey took 2.5 hours.
This argument is sound.
> 4. Not sure using high-resolution is the answer
> -----------------------------------------------
> While a fine-grained timer resolution may be desirable, it is not
> necessarily a must. The implementation of rate-based pacing in TCP
> (http://www.isi.edu/~johnh/PAPERS/Visweswaraiah97b.html) for instance
> also used low(er) resolution timers and it worked.
>
> The RFC for CCID-3 (http://www.rfc-archive.org/getrfc.php?rfc=5348) also
> does not high-resolution; it supports coarse-grained timestamps (section
> 6.3 and RFC 4342) and discusses implementation issues when using a
> lower resolution (section 8.3).
>
> The counter-argument could be that CCID-3 is a transport protocol with a
> built-in Token Bucket Filter so that similar considerations apply as for
> the Qdisc API (net/sched/sch_api.c).
>
> Summing up, I have doubts that basing CCID-3 will bring advantages and
> would much rather go the other way and (consistently) use lower resolution.
>
> Thoughts?
I wouldn't bother with high resolution timers, mostly because they are more
expensive and the benefit of them here is at best "unknown".
next prev parent reply other threads:[~2008-11-17 6:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5bc4c4570810171021ua6371ebs1ffdf471382a8b13@mail.gmail.com>
[not found] ` <20081105052733.GG6564@gerrit.erg.abdn.ac.uk>
[not found] ` <5bc4c4570811060538h2d662507u5de1fb62c61cd569@mail.gmail.com>
[not found] ` <20081106152048.GA3621@gerrit.erg.abdn.ac.uk>
[not found] ` <20081106153824.GA9709@ghostprotocols.net>
[not found] ` <5bc4c4570811060946j4d5d8d1mf88f8b92c72b59c7@mail.gmail.com>
[not found] ` <5bc4c4570811061004nfc2afdcn6035d49ae654aef1@mail.gmail.com>
[not found] ` <5bc4c4570811061017j3acef860vee84992e7295d06d@mail.gmail.com>
[not found] ` <5bc4c4570811061405qe72e43cx861c537885804132@mail.gmail.com>
[not found] ` <20081108085035.GA7112@gerrit.erg.abdn.ac.uk>
2008-11-15 10:50 ` [RFC] dccp ccid-3: High-res or low-res timers? Gerrit Renker
2008-11-16 8:14 ` Ian McDonald
2008-11-17 6:48 ` David Miller [this message]
2008-11-18 5:07 ` Gerrit Renker
2008-11-17 19:27 ` Eddie Kohler
[not found] ` <5640c7e00811160014p17414c54v2499c5b1e996278f@mail.gmail.com>
2008-11-17 21:16 ` [RFC] dccp ccid-3: High-res or low-res timers? <cross post> Gorry Fairhurst
2008-11-18 6:14 ` [RFC] dccp ccid-3: High-res or low-res timers? Gerrit Renker
2008-11-18 17:41 ` Ian McDonald
2008-11-20 6:24 ` Gerrit Renker
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=20081116.224834.166724077.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=acme@redhat.com \
--cc=dccp@vger.kernel.org \
--cc=gerrit@erg.abdn.ac.uk \
--cc=ian.mcdonald@jandi.co.nz \
--cc=leandroal@gmail.com \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).