diff options
author | Eliezer Tamir <eliezer.tamir@linux.intel.com> | 2013-07-02 16:22:47 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-07-02 18:53:53 -0400 |
commit | 1bc2774d866444c5b316fd1dc2b782f20c762cf4 (patch) | |
tree | dfadce12c9f45c80cd372b27456151be000c8aee /fs/select.c | |
parent | 7e6d4da837385d9aa2e5fd84e0a6042cddc9e708 (diff) |
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.c | 10 |
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) | |||
403 | int retval, i, timed_out = 0; | 403 | int retval, i, timed_out = 0; |
404 | unsigned long slack = 0; | 404 | unsigned long slack = 0; |
405 | unsigned int ll_flag = ll_get_flag(); | 405 | unsigned int ll_flag = ll_get_flag(); |
406 | u64 ll_time = ll_end_time(); | 406 | u64 ll_start = ll_start_time(ll_flag); |
407 | u64 ll_time = ll_run_time(); | ||
407 | 408 | ||
408 | rcu_read_lock(); | 409 | rcu_read_lock(); |
409 | retval = max_select_fd(n, fds); | 410 | retval = max_select_fd(n, fds); |
@@ -498,7 +499,7 @@ int do_select(int n, fd_set_bits *fds, struct timespec *end_time) | |||
498 | } | 499 | } |
499 | 500 | ||
500 | /* only if on, have sockets with POLL_LL and not out of time */ | 501 | /* only if on, have sockets with POLL_LL and not out of time */ |
501 | if (ll_flag && can_ll && can_poll_ll(ll_time)) | 502 | if (ll_flag && can_ll && can_poll_ll(ll_start, ll_time)) |
502 | continue; | 503 | continue; |
503 | 504 | ||
504 | /* | 505 | /* |
@@ -770,7 +771,8 @@ static int do_poll(unsigned int nfds, struct poll_list *list, | |||
770 | int timed_out = 0, count = 0; | 771 | int timed_out = 0, count = 0; |
771 | unsigned long slack = 0; | 772 | unsigned long slack = 0; |
772 | unsigned int ll_flag = ll_get_flag(); | 773 | unsigned int ll_flag = ll_get_flag(); |
773 | u64 ll_time = ll_end_time(); | 774 | u64 ll_start = ll_start_time(ll_flag); |
775 | u64 ll_time = ll_run_time(); | ||
774 | 776 | ||
775 | /* Optimise the no-wait case */ | 777 | /* Optimise the no-wait case */ |
776 | if (end_time && !end_time->tv_sec && !end_time->tv_nsec) { | 778 | 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, | |||
819 | break; | 821 | break; |
820 | 822 | ||
821 | /* only if on, have sockets with POLL_LL and not out of time */ | 823 | /* only if on, have sockets with POLL_LL and not out of time */ |
822 | if (ll_flag && can_ll && can_poll_ll(ll_time)) | 824 | if (ll_flag && can_ll && can_poll_ll(ll_start, ll_time)) |
823 | continue; | 825 | continue; |
824 | 826 | ||
825 | /* | 827 | /* |