summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSimon Kirby <sim@hostway.ca>2013-08-10 01:26:18 -0700
committerSimon Horman <horms@verge.net.au>2013-09-18 14:38:53 -0500
commitc16526a7b99c1c28e9670a8c8e3dbcf741bb32be (patch)
tree3134c8f812db8676c77f265538289cfe278bb1e1 /include
parent61c5923a2f2d8ab98a1e3c76f17e0f4a871ec75b (diff)
downloadlinux-stable-c16526a7b99c1c28e9670a8c8e3dbcf741bb32be.tar.gz
linux-stable-c16526a7b99c1c28e9670a8c8e3dbcf741bb32be.tar.bz2
linux-stable-c16526a7b99c1c28e9670a8c8e3dbcf741bb32be.zip
ipvs: fix overflow on dest weight multiply
Schedulers such as lblc and lblcr require the weight to be as high as the maximum number of active connections. In commit b552f7e3a9524abcbcdf ("ipvs: unify the formula to estimate the overhead of processing connections"), the consideration of inactconns and activeconns was cleaned up to always count activeconns as 256 times more important than inactconns. In cases where 3000 or more connections are expected, a weight of 3000 * 256 * 3000 connections overflows the 32-bit signed result used to determine if rescheduling is required. On amd64, this merely changes the multiply and comparison instructions to 64-bit. On x86, a 64-bit result is already present from imull, so only a few more comparison instructions are emitted. Signed-off-by: Simon Kirby <sim@hostway.ca> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'include')
-rw-r--r--include/net/ip_vs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index f0d70f066f3d..fe782ed2fe72 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -1649,7 +1649,7 @@ static inline void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp)
/* CONFIG_IP_VS_NFCT */
#endif
-static inline unsigned int
+static inline int
ip_vs_dest_conn_overhead(struct ip_vs_dest *dest)
{
/*