net: convert lls to use time_in_range()
Time in range will fail safely if we move to a different cpu with an
extremely large clock skew.
Add time_in_range64() and convert lls to use it.
changelog:
v2
- fixed double call to sched_clock in can_poll_ll
- fixed checkpatchisms
Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/fs/select.c b/fs/select.c
index 3654075..f28a585 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -403,7 +403,8 @@
int retval, i, timed_out = 0;
unsigned long slack = 0;
unsigned int ll_flag = ll_get_flag();
- u64 ll_time = ll_end_time();
+ u64 ll_start = ll_start_time(ll_flag);
+ u64 ll_time = ll_run_time();
rcu_read_lock();
retval = max_select_fd(n, fds);
@@ -498,7 +499,7 @@
}
/* only if on, have sockets with POLL_LL and not out of time */
- if (ll_flag && can_ll && can_poll_ll(ll_time))
+ if (ll_flag && can_ll && can_poll_ll(ll_start, ll_time))
continue;
/*
@@ -770,7 +771,8 @@
int timed_out = 0, count = 0;
unsigned long slack = 0;
unsigned int ll_flag = ll_get_flag();
- u64 ll_time = ll_end_time();
+ u64 ll_start = ll_start_time(ll_flag);
+ u64 ll_time = ll_run_time();
/* Optimise the no-wait case */
if (end_time && !end_time->tv_sec && !end_time->tv_nsec) {
@@ -819,7 +821,7 @@
break;
/* only if on, have sockets with POLL_LL and not out of time */
- if (ll_flag && can_ll && can_poll_ll(ll_time))
+ if (ll_flag && can_ll && can_poll_ll(ll_start, ll_time))
continue;
/*