aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@gmail.com>2009-06-08 18:05:13 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-09 08:25:30 -0400
commita4a710c4a7490587406462bf1d54504b7783d7d7 (patch)
treec6d0c9c1e54626cba706a3f9ce2e077afadc9eb0
parent728bf09827d350cdaa1f093170e745e8dac49b7a (diff)
pkt_sched: Change PSCHED_SHIFT from 10 to 6
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> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/pkt_sched.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index cd0e026d4f6a..120935b2abd8 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -41,8 +41,8 @@ static inline void *qdisc_priv(struct Qdisc *q)
41typedef u64 psched_time_t; 41typedef u64 psched_time_t;
42typedef long psched_tdiff_t; 42typedef long psched_tdiff_t;
43 43
44/* Avoid doing 64 bit divide by 1000 */ 44/* Avoid doing 64 bit divide */
45#define PSCHED_SHIFT 10 45#define PSCHED_SHIFT 6
46#define PSCHED_US2NS(x) ((s64)(x) << PSCHED_SHIFT) 46#define PSCHED_US2NS(x) ((s64)(x) << PSCHED_SHIFT)
47#define PSCHED_NS2US(x) ((x) >> PSCHED_SHIFT) 47#define PSCHED_NS2US(x) ((x) >> PSCHED_SHIFT)
48 48