OSDN Git Service

tipc: use existing sk_write_queue for outgoing packet chain
authorJon Paul Maloy <jon.maloy@ericsson.com>
Thu, 5 Feb 2015 13:36:40 +0000 (08:36 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Feb 2015 00:00:02 +0000 (16:00 -0800)
commit94153e36e709e78fc4e1f93dc4e4da785690c7d1
tree153c7d99adc7566b0d4c67b0cdade977b41b6573
parente3a77561e7d326e18881ef3cb84807892b353459
tipc: use existing sk_write_queue for outgoing packet chain

The list for outgoing traffic buffers from a socket is currently
allocated on the stack. This forces us to initialize the queue for
each sent message, something costing extra CPU cycles in the most
critical data path. Later in this series we will introduce a new
safe input buffer queue, something that would force us to initialize
even the spinlock of the outgoing queue. A closer analysis reveals
that the queue always is filled and emptied within the same lock_sock()
session. It is therefore safe to use a queue aggregated in the socket
itself for this purpose. Since there already exists a queue for this
in struct sock, sk_write_queue, we introduce use of that queue in
this commit.

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