]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: avoid to unnecessary process switch under non-block mode
authorYing Xue <ying.xue@windriver.com>
Thu, 6 Mar 2014 13:40:18 +0000 (14:40 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Mar 2014 19:46:23 +0000 (14:46 -0500)
commitf936651f490f5eb446bcbf2f431087c91c077831
tree383c648ffdef61232e623f723f17247dcb860faf
parente393d22963c9c1ba9b072fe0a11bdfeb60a330b9
tipc: avoid to unnecessary process switch under non-block mode

When messages are received via tipc socket under non-block mode,
schedule_timeout() is called in tipc_wait_for_rcvmsg(), that is,
the process of receiving messages will be scheduled once although
timeout value passed to schedule_timeout() is 0. The same issue
exists in accept()/wait_for_accept(). To avoid this unnecessary
process switch, we only call schedule_timeout() if the timeout
value is non-zero.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/socket.c