]> git.baikalelectronics.ru Git - kernel.git/commit
ipvs: fix overflow on dest weight multiply
authorSimon Kirby <sim@hostway.ca>
Sat, 10 Aug 2013 08:26:18 +0000 (01:26 -0700)
committerSimon Horman <horms@verge.net.au>
Wed, 18 Sep 2013 19:38:53 +0000 (14:38 -0500)
commit60022499644b13f4f7b3aca3113ae347d83231ca
tree3134c8f812db8676c77f265538289cfe278bb1e1
parent69fc9ba839a765bc82993c3ebe78ef58992ce580
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 0d3e36df43a736a31c30
("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>
include/net/ip_vs.h
net/netfilter/ipvs/ip_vs_lblc.c
net/netfilter/ipvs/ip_vs_lblcr.c
net/netfilter/ipvs/ip_vs_nq.c
net/netfilter/ipvs/ip_vs_sed.c
net/netfilter/ipvs/ip_vs_wlc.c