diff options
author | Eliezer Tamir <eliezer.tamir@linux.intel.com> | 2013-06-28 15:59:35 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-07-01 14:06:47 -0700 |
commit | 91e2fd337839319c7745e2cb84cfbf8cf1426a1a (patch) | |
tree | 1a832c8fb04fc687dfd40e4a4b69b15d60049172 /fs | |
parent | ad6276e0fe724b1c8ac3a0bf138d151665ab2349 (diff) | |
download | op-kernel-dev-91e2fd337839319c7745e2cb84cfbf8cf1426a1a.zip op-kernel-dev-91e2fd337839319c7745e2cb84cfbf8cf1426a1a.tar.gz |
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.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/select.c b/fs/select.c index 79b876e..3654075 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) poll_table *wait; int retval, i, timed_out = 0; unsigned long slack = 0; - unsigned int ll_flag = POLL_LL; + unsigned int ll_flag = ll_get_flag(); u64 ll_time = ll_end_time(); rcu_read_lock(); @@ -497,7 +497,8 @@ int do_select(int n, fd_set_bits *fds, struct timespec *end_time) break; } - if (can_ll && can_poll_ll(ll_time)) + /* only if on, have sockets with POLL_LL and not out of time */ + if (ll_flag && can_ll && can_poll_ll(ll_time)) continue; /* @@ -768,7 +769,7 @@ static int do_poll(unsigned int nfds, struct poll_list *list, ktime_t expire, *to = NULL; int timed_out = 0, count = 0; unsigned long slack = 0; - unsigned int ll_flag = POLL_LL; + unsigned int ll_flag = ll_get_flag(); u64 ll_time = ll_end_time(); /* Optimise the no-wait case */ @@ -817,8 +818,10 @@ static int do_poll(unsigned int nfds, struct poll_list *list, if (count || timed_out) break; - if (can_ll && can_poll_ll(ll_time)) + /* only if on, have sockets with POLL_LL and not out of time */ + if (ll_flag && can_ll && can_poll_ll(ll_time)) continue; + /* * If this is the first loop and we have a timeout * given, then we convert to ktime_t and set the to |