From: Jarek Poplawski <jarkao2@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: Patrick McHardy <kaber@trash.net>,
Antonio Almeida <vexwek@gmail.com>,
Stephen Hemminger <shemminger@vyatta.com>,
netdev@vger.kernel.org, Martin Devera <devik@cdi.cz>,
Eric Dumazet <dada1@cosmosbay.com>,
Vladimir Ivashchenko <hazard@francoudi.com>,
Badalian Vyacheslav <slavon@bigtelecom.ru>
Subject: [PATCH 2/2] pkt_sched: Change PSCHED_SHIFT from 10 to 6
Date: Tue, 9 Jun 2009 08:05:13 +0000 [thread overview]
Message-ID: <20090609080513.GB5237@ff.dom.local> (raw)
Change PSCHED_SHIFT from 10 to 6 to increase schedulers time
resolution. This will increase 16x a number of (internal) ticks per
nanosecond, and is needed to improve accuracy of schedulers based on
rate tables, like HTB, TBF or CBQ, with rates above 100Mbit. It is
assumed this change is safe for 32bit accounting of time diffs up
to 2 minutes, which should be enough for common use (extremely low
rate values may overflow, so get inaccurate instead). To make full
use of this change an updated iproute2 will be needed. (But using
older iproute2 should be safe too.)
This change breaks ticks - microseconds similarity, so some minor code
fixes might be needed. It is also planned to change naming adequately
eg. to PSCHED_TICKS2NS() etc. in the near future.
Reported-by: Antonio Almeida <vexwek@gmail.com>
Tested-by: Antonio Almeida <vexwek@gmail.com>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
---
diff -Nurp a/include/net/pkt_sched.h b/include/net/pkt_sched.h
--- a/include/net/pkt_sched.h 2009-06-08 23:06:31.000000000 +0200
+++ b/include/net/pkt_sched.h 2009-06-08 23:23:53.000000000 +0200
@@ -41,8 +41,8 @@ static inline void *qdisc_priv(struct Qd
typedef u64 psched_time_t;
typedef long psched_tdiff_t;
-/* Avoid doing 64 bit divide by 1000 */
-#define PSCHED_SHIFT 10
+/* Avoid doing 64 bit divide */
+#define PSCHED_SHIFT 6
#define PSCHED_US2NS(x) ((s64)(x) << PSCHED_SHIFT)
#define PSCHED_NS2US(x) ((x) >> PSCHED_SHIFT)
next reply other threads:[~2009-06-09 8:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-09 8:05 Jarek Poplawski [this message]
2009-06-09 12:21 ` [PATCH 2/2] pkt_sched: Change PSCHED_SHIFT from 10 to 6 David Miller
2009-06-15 9:15 ` [PATCH 3/2] pkt_sched: Rename PSCHED_US2NS and PSCHED_NS2US Jarek Poplawski
2009-06-15 9:32 ` David Miller
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=20090609080513.GB5237@ff.dom.local \
--to=jarkao2@gmail.com \
--cc=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=devik@cdi.cz \
--cc=hazard@francoudi.com \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
--cc=slavon@bigtelecom.ru \
--cc=vexwek@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;
as well as URLs for NNTP newsgroup(s).