LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [Patch] Overload flag is not resetting

To: Julian Anastasov <ja@xxxxxx>
Subject: Re: [Patch] Overload flag is not resetting
Cc: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
From: Horms <horms@xxxxxxxxxxxx>
Date: Fri, 4 Feb 2005 19:46:13 +0900
On Fri, Feb 04, 2005 at 12:37:37PM +0200, Julian Anastasov wrote:
> 
>       Hello,
> 
> On Fri, 4 Feb 2005, Horms wrote:
> 
> > >   Can you change WRR on update instead of setting mark->cw to 0,
> > > to clamp it to mw, sort of:
> > >
> > > if (mark->cw > mark->mw)
> > >   mark->cw = mark->mw;
> 
> > >   Can this fix a problem where on reducing the max weight
> > > no dests are returned until cw reaches down to mw.
> >
> > Yes, I am pretty sure that problem would be resolved.
> > Either with the previous two patches (which both set mark->cw to 0),
> > or the one below which implements your idea.
> 
>       Better move the two lines just before return 0 where mw is
> valid.

Yes, silly me.

-- 
Horms

===== net/ipv4/ipvs/ip_vs_wrr.c 1.5 vs edited =====
--- 1.5/net/ipv4/ipvs/ip_vs_wrr.c       2004-02-19 06:03:53 +09:00
+++ edited/net/ipv4/ipvs/ip_vs_wrr.c    2005-02-04 19:45:37 +09:00
@@ -25,6 +25,8 @@
 
 #include <net/ip_vs.h>
 
+static int ip_vs_wrr_update_svc(struct ip_vs_service *svc);
+
 /*
  * current destination pointer for weighted round-robin scheduling
  */
@@ -98,11 +100,9 @@ static int ip_vs_wrr_init_svc(struct ip_
                IP_VS_ERR("ip_vs_wrr_init_svc(): no memory\n");
                return -ENOMEM;
        }
-       mark->cl = &svc->destinations;
        mark->cw = 0;
-       mark->mw = ip_vs_wrr_max_weight(svc);
-       mark->di = ip_vs_wrr_gcd_weight(svc);
        svc->sched_data = mark;
+       ip_vs_wrr_update_svc(svc);
 
        return 0;
 }
@@ -126,6 +126,8 @@ static int ip_vs_wrr_update_svc(struct i
        mark->cl = &svc->destinations;
        mark->mw = ip_vs_wrr_max_weight(svc);
        mark->di = ip_vs_wrr_gcd_weight(svc);
+       if (mark->cw > mark->mw)
+                mark->cw = mark->mw;
        return 0;
 }
 

<Prev in Thread] Current Thread [Next in Thread>