aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorEliezer Tamir <eliezer.tamir@linux.intel.com>2013-06-28 08:59:35 -0400
committerDavid S. Miller <davem@davemloft.net>2013-07-01 17:06:47 -0400
commit91e2fd337839319c7745e2cb84cfbf8cf1426a1a (patch)
tree1a832c8fb04fc687dfd40e4a4b69b15d60049172 /fs
parentad6276e0fe724b1c8ac3a0bf138d151665ab2349 (diff)
net: avoid calling sched_clock when LLS is off
Change Low Latency Sockets code for select and poll so that when LLS is disabled sched_clock() is never called. Also, avoid sending POLL_LL to sockets if disabled. Reported-by: Andi Kleen <andi@firstfloor.org> Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs')
-rw-r--r--fs/select.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/select.c b/fs/select.c
index 79b876eb91da..36540754bad7 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -402,7 +402,7 @@ int do_select(int n, fd_set_bits *fds, struct timespec *end_time)
402 poll_table *wait; 402 poll_table *wait;
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 = POLL_LL; 405 unsigned int ll_flag = ll_get_flag();
406 u64 ll_time = ll_end_time(); 406 u64 ll_time = ll_end_time();
407 407
408 rcu_read_lock(); 408 rcu_read_lock();
@@ -497,7 +497,8 @@ int do_select(int n, fd_set_bits *fds, struct timespec *end_time)
497 break; 497 break;
498 } 498 }
499 499
500 if (can_ll && can_poll_ll(ll_time)) 500 /* only if on, have sockets with POLL_LL and not out of time */
501 if (ll_flag && can_ll && can_poll_ll(ll_time))
501 continue; 502 continue;
502 503
503 /* 504 /*
@@ -768,7 +769,7 @@ static int do_poll(unsigned int nfds, struct poll_list *list,
768 ktime_t expire, *to = NULL; 769 ktime_t expire, *to = NULL;
769 int timed_out = 0, count = 0; 770 int timed_out = 0, count = 0;
770 unsigned long slack = 0; 771 unsigned long slack = 0;
771 unsigned int ll_flag = POLL_LL; 772 unsigned int ll_flag = ll_get_flag();
772 u64 ll_time = ll_end_time(); 773 u64 ll_time = ll_end_time();
773 774
774 /* Optimise the no-wait case */ 775 /* Optimise the no-wait case */
@@ -817,8 +818,10 @@ static int do_poll(unsigned int nfds, struct poll_list *list,
817 if (count || timed_out) 818 if (count || timed_out)
818 break; 819 break;
819 820
820 if (can_ll && can_poll_ll(ll_time)) 821 /* only if on, have sockets with POLL_LL and not out of time */
822 if (ll_flag && can_ll && can_poll_ll(ll_time))
821 continue; 823 continue;
824
822 /* 825 /*
823 * If this is the first loop and we have a timeout 826 * If this is the first loop and we have a timeout
824 * given, then we convert to ktime_t and set the to 827 * given, then we convert to ktime_t and set the to