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_lc.c | |
parent | 17a8f8e3734920cf2f030f2fa521a0b940ef6f90 (diff) | |
download | kernel_samsung_smdk4412-b552f7e3a9524abcbcdf86f0a99b2be58e55a9c6.zip kernel_samsung_smdk4412-b552f7e3a9524abcbcdf86f0a99b2be58e55a9c6.tar.gz kernel_samsung_smdk4412-b552f7e3a9524abcbcdf86f0a99b2be58e55a9c6.tar.bz2 |
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_lc.c')
-rw-r--r-- | net/netfilter/ipvs/ip_vs_lc.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/net/netfilter/ipvs/ip_vs_lc.c b/net/netfilter/ipvs/ip_vs_lc.c index 6063800..f391819 100644 --- a/net/netfilter/ipvs/ip_vs_lc.c +++ b/net/netfilter/ipvs/ip_vs_lc.c @@ -22,22 +22,6 @@ #include <net/ip_vs.h> - -static inline unsigned int -ip_vs_lc_dest_overhead(struct ip_vs_dest *dest) -{ - /* - * We think the overhead of processing active connections is 256 - * times higher than that of inactive connections in average. (This - * 256 times might not be accurate, we will change it later) We - * use the following formula to estimate the overhead now: - * dest->activeconns*256 + dest->inactconns - */ - return (atomic_read(&dest->activeconns) << 8) + - atomic_read(&dest->inactconns); -} - - /* * Least Connection scheduling */ @@ -62,7 +46,7 @@ ip_vs_lc_schedule(struct ip_vs_service *svc, const struct sk_buff *skb) if ((dest->flags & IP_VS_DEST_F_OVERLOAD) || atomic_read(&dest->weight) == 0) continue; - doh = ip_vs_lc_dest_overhead(dest); + doh = ip_vs_dest_conn_overhead(dest); if (!least || doh < loh) { least = dest; loh = doh; |