Skip to content
Commit c16526a7 authored by Simon Kirby's avatar Simon Kirby Committed by Simon Horman
Browse files

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 b552f7e3
("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: default avatarSimon Kirby <sim@hostway.ca>
Acked-by: default avatarJulian Anastasov <ja@ssi.bg>
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
parent 61c5923a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment