summaryrefslogtreecommitdiffstats
path: root/fs/select.c
diff options
context:
space:
mode:
authorEliezer Tamir <eliezer.tamir@linux.intel.com>2013-07-02 23:22:47 +0300
committerDavid S. Miller <davem@davemloft.net>2013-07-02 15:53:53 -0700
commit1bc2774d866444c5b316fd1dc2b782f20c762cf4 (patch)
treedfadce12c9f45c80cd372b27456151be000c8aee /fs/select.c
parent7e6d4da837385d9aa2e5fd84e0a6042cddc9e708 (diff)
downloadlinux-stable-1bc2774d866444c5b316fd1dc2b782f20c762cf4.tar.gz
linux-stable-1bc2774d866444c5b316fd1dc2b782f20c762cf4.tar.bz2
linux-stable-1bc2774d866444c5b316fd1dc2b782f20c762cf4.zip
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>
Diffstat (limited to 'fs/select.c')
-rw-r--r--fs/select.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/select.c b/fs/select.c
index 36540754bad7..f28a58592725 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -403,7 +403,8 @@ int do_select(int n, fd_set_bits *fds, struct timespec *end_time)
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 @@ int do_select(int n, fd_set_bits *fds, struct timespec *end_time)
}
/* 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 @@ static int do_poll(unsigned int nfds, struct poll_list *list,
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 @@ static int do_poll(unsigned int nfds, struct poll_list *list,
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;
/*