]> git.karo-electronics.de Git - karo-tx-linux.git/commit
tcp: Combat per-cpu skew in orphan tests.
authorDavid S. Miller <davem@davemloft.net>
Wed, 25 Aug 2010 09:27:49 +0000 (02:27 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 27 Sep 2010 00:21:17 +0000 (17:21 -0700)
commita89d316f2bdf5df8f9a109d32f0e7b0940041e7f
tree5b6e3a0c5b305d0c7cd8654b4df2b638ce94a300
parentebde7b9827da782d1fd0a51cdbac81b589552494
tcp: Combat per-cpu skew in orphan tests.

[ Upstream commit ad1af0fedba14f82b240a03fe20eb9b2fdbd0357 ]

As reported by Anton Blanchard when we use
percpu_counter_read_positive() to make our orphan socket limit checks,
the check can be off by up to num_cpus_online() * batch (which is 32
by default) which on a 128 cpu machine can be as large as the default
orphan limit itself.

Fix this by doing the full expensive sum check if the optimized check
triggers.

Reported-by: Anton Blanchard <anton@samba.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/net/tcp.h
net/ipv4/tcp.c
net/ipv4/tcp_timer.c