diff options
author | Changli Gao <xiaosuo@gmail.com> | 2011-02-19 17:32:28 +0800 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2011-02-25 11:35:41 +0900 |
commit | b552f7e3a9524abcbcdf86f0a99b2be58e55a9c6 (patch) | |
tree | ee31994b40078e0b04eb35e558141b7b3834edbd /net/netfilter/ipvs/ip_vs_lblc.c | |
parent | 17a8f8e3734920cf2f030f2fa521a0b940ef6f90 (diff) | |
download | op-kernel-dev-b552f7e3a9524abcbcdf86f0a99b2be58e55a9c6.zip op-kernel-dev-b552f7e3a9524abcbcdf86f0a99b2be58e55a9c6.tar.gz |
ipvs: unify the formula to estimate the overhead of processing connections
lc and wlc use the same formula, but lblc and lblcr use another one. There
is no reason for using two different formulas for the lc variants.
The formula used by lc is used by all the lc variants in this patch.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Acked-by: Wensong Zhang <wensong@linux-vs.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'net/netfilter/ipvs/ip_vs_lblc.c')
-rw-r--r-- | net/netfilter/ipvs/ip_vs_lblc.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c index 4a9c8cd..6bf7a80 100644 --- a/net/netfilter/ipvs/ip_vs_lblc.c +++ b/net/netfilter/ipvs/ip_vs_lblc.c @@ -389,12 +389,7 @@ __ip_vs_lblc_schedule(struct ip_vs_service *svc) int loh, doh; /* - * We think the overhead of processing active connections is fifty - * times higher than that of inactive connections in average. (This - * fifty times might not be accurate, we will change it later.) We - * use the following formula to estimate the overhead: - * dest->activeconns*50 + dest->inactconns - * and the load: + * We use the following formula to estimate the load: * (dest overhead) / dest->weight * * Remember -- no floats in kernel mode!!! @@ -410,8 +405,7 @@ __ip_vs_lblc_schedule(struct ip_vs_service *svc) continue; if (atomic_read(&dest->weight) > 0) { least = dest; - loh = atomic_read(&least->activeconns) * 50 - + atomic_read(&least->inactconns); + loh = ip_vs_dest_conn_overhead(least); goto nextstage; } } @@ -425,8 +419,7 @@ __ip_vs_lblc_schedule(struct ip_vs_service *svc) if (dest->flags & IP_VS_DEST_F_OVERLOAD) continue; - doh = atomic_read(&dest->activeconns) * 50 - + atomic_read(&dest->inactconns); + doh = ip_vs_dest_conn_overhead(dest); if (loh * atomic_read(&dest->weight) > doh * atomic_read(&least->weight)) { least = dest; |