LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

[PATCH-2.4] fix locking in est scheduler

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: [PATCH-2.4] fix locking in est scheduler
From: Roberto Nibali <ratz@xxxxxx>
Date: Fri, 27 Jun 2003 15:55:14 +0200
Hi Wensong,

I promised to clean up the code a bit but this week was once again a desaster time-wise. First a family member passed away and I thus had to organise the funeral and other things and then I had some issues with the military (I finally got released from duty, after 7 years of pain and anger in the army!!!). So there is only little coming from me and you might as well just release the next drop:

This patch addresses the locking in the est scheduler (I wasn't aware of it :)). It is then compliant to 2.5.x locking. Please consider applying if correct.

Questions:
o What about syncing the OVERLOADED code from 2.5.x to 2.4.x?
o What do you think about introducing the sltimer changes from 2.5.x to 2.4.x?
o Why do we have two different services list traversals for rr and wrr?

Best regards,
Roberto Nibali, ratz
--
echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq' | dc
diff -ur ipvs-1.0.9-misc/ipvs/ip_vs_est.c ipvs-1.0.9-cleanup/ipvs/ip_vs_est.c
--- ipvs-1.0.9-misc/ipvs/ip_vs_est.c    2002-07-11 16:26:41.000000000 +0200
+++ ipvs-1.0.9-cleanup/ipvs/ip_vs_est.c 2003-06-26 11:36:38.000000000 +0200
@@ -139,6 +139,7 @@
        est->last_outbytes = stats->outbytes;
        est->outbps = stats->outbps<<5;
 
+       write_lock_bh(&est_lock);
        est->next = est_list;
        if (est->next == NULL) {
                init_timer(&est_timer);
@@ -146,7 +147,6 @@
                est_timer.function = estimation_timer;
                add_timer(&est_timer);
        }
-       write_lock_bh(&est_lock);
        est_list = est;
        write_unlock_bh(&est_lock);
        return 0;
<Prev in Thread] Current Thread [Next in Thread>