netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] (4/4) packet scheduler -- use get_jiffies_64
@ 2004-06-29 21:00 Stephen Hemminger
  2004-06-29 21:46 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2004-06-29 21:00 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

The packet scheduler simulates 64 bit jiffies on 32 bit platforms by running
a timer keeping a mark and and offset.  Since there is no locking and this is
racy and doesn't handle jiffie wrap real well.

We can use get_jiffies_64 on 2.6 do get what is needed.
The downside is the overhead of a function call, and a cache miss in get_jiffies_64.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
 
diff -Nru a/include/net/pkt_sched.h b/include/net/pkt_sched.h
--- a/include/net/pkt_sched.h	2004-06-29 11:33:37 -07:00
+++ b/include/net/pkt_sched.h	2004-06-29 11:33:37 -07:00
@@ -231,20 +231,7 @@
 #define PSCHED_JSCALE 10
 #endif
 
-#if BITS_PER_LONG <= 32
-
-#define PSCHED_WATCHER unsigned long
-
-extern PSCHED_WATCHER psched_time_mark;
-
-#define PSCHED_GET_TIME(stamp) ((stamp) = psched_time_base + (((unsigned long)(jiffies-psched_time_mark))<<PSCHED_JSCALE))
-
-#else
-
-#define PSCHED_GET_TIME(stamp) ((stamp) = (jiffies<<PSCHED_JSCALE))
-
-#endif
-
+#define PSCHED_GET_TIME(stamp) ((stamp) = (get_jiffies_64()<<PSCHED_JSCALE))
 #define PSCHED_US2JIFFIE(delay) (((delay)+(1<<PSCHED_JSCALE)-1)>>PSCHED_JSCALE)
 #define PSCHED_JIFFIE2US(delay) ((delay)<<PSCHED_JSCALE)
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] (4/4) packet scheduler -- use get_jiffies_64
  2004-06-29 21:00 [PATCH] (4/4) packet scheduler -- use get_jiffies_64 Stephen Hemminger
@ 2004-06-29 21:46 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2004-06-29 21:46 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

On Tue, 29 Jun 2004 14:00:21 -0700
Stephen Hemminger <shemminger@osdl.org> wrote:

> The packet scheduler simulates 64 bit jiffies on 32 bit platforms by running
> a timer keeping a mark and and offset.  Since there is no locking and this is
> racy and doesn't handle jiffie wrap real well.
> 
> We can use get_jiffies_64 on 2.6 do get what is needed.
> The downside is the overhead of a function call, and a cache miss in get_jiffies_64.

Looks great, applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-06-29 21:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-29 21:00 [PATCH] (4/4) packet scheduler -- use get_jiffies_64 Stephen Hemminger
2004-06-29 21:46 ` David S. Miller

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).