Thread (9 messages) flat view 9 messages, 2 authors, 2013-06-14

Re: [PATCH v4 net-next 2/4] net: convert low latency sockets to sched_clock()

From: Eric Dumazet <hidden>
Date: 2013-06-14 03:12:57
Also in: lkml

On Fri, 2013-06-14 at 04:57 +0300, Eliezer Tamir wrote:
Use sched_clock() instead of get_cycles().
We can use sched_clock() because we don't care much about accuracy.
Remove the dependency on X86_TSC

Signed-off-by: Eliezer Tamir <redacted>
---
 
-static inline bool can_poll_ll(cycles_t end_time)
+static inline bool can_poll_ll(u64 end_time)
 {
-	return !time_after((unsigned long)get_cycles(),
+	return !time_after((unsigned long)sched_clock(),
 			    (unsigned long)end_time);
 }
I do not really understand why you bother to have 64bit wide values,
and then use these "unsigned long" casts here.

On 32bit arches, this will really limit to 2^31 ns range.

You should instead either :
- use time_after_64() or 
- explicitly limit sysctl_net_ll_poll range



------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help