]> asedeno.scripts.mit.edu Git - linux.git/commit
tipc: improve poll() for group member socket
authorJon Maloy <jon.maloy@ericsson.com>
Mon, 8 Jan 2018 20:03:31 +0000 (21:03 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Jan 2018 17:35:58 +0000 (12:35 -0500)
commiteb929a91b213d2a72c5a8b4af9a1acf63bfb8287
tree9562eb2a8fc216296ce455d4b124ada6b13ca965
parent232d07b74a33b9f5d48516dc1d8ce41723ada593
tipc: improve poll() for group member socket

The current criteria for returning POLLOUT from a group member socket is
too simplistic. It basically returns POLLOUT as soon as the group has
external destinations, something obviously leading to a lot of spinning
during destination congestion situations. At the same time, the internal
congestion handling is unnecessarily complex.

We now change this as follows.

- We introduce an 'open' flag in  struct tipc_group. This flag is used
  only to help poll() get the setting of POLLOUT right, and *not* for
  congeston handling as such. This means that a user can choose to
  ignore an  EAGAIN for a destination and go on sending messages to
  other destinations in the group if he wants to.

- The flag is set to false every time we return EAGAIN on a send call.

- The flag is set to true every time any member, i.e., not necessarily
  the member that caused EAGAIN, is removed from the small_win list.

- We remove the group member 'usr_pending' flag. The size of the send
  window and presence in the 'small_win' list is sufficient criteria
  for recognizing congestion.

This solution seems to be a reasonable compromise between 'anycast',
which is normally not waiting for POLLOUT for a specific destination,
and the other three send modes, which are.

Acked-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/group.c
net/tipc/group.h
net/tipc/socket.c