]> git.baikalelectronics.ru Git - kernel.git/commit
netlink: Use random autobind rover
authorHerbert Xu <herbert@gondor.apana.org.au>
Sun, 17 May 2015 02:45:34 +0000 (10:45 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 May 2015 03:43:31 +0000 (23:43 -0400)
commitbf37df6f6509df1b1579ed2f40548bc7b1db0201
tree028eeb771c3f596b66853dce3a22d93425848187
parent9a4f2932631837ae0742e5623ea28c36c2ba804b
netlink: Use random autobind rover

Currently we use a global rover to select a port ID that is unique.
This used to work consistently when it was protected with a global
lock.  However as we're now lockless, the global rover can exhibit
pathological behaviour should multiple threads all stomp on it at
the same time.

Granted this will eventually resolve itself but the process is
suboptimal.

This patch replaces the global rover with a pseudorandom starting
point to avoid this issue.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netlink/af_netlink.c