LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: Help with ip_vs_ctl.c~ipvs-deadlock-fix patch and RedHat ES 4

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: Help with ip_vs_ctl.c~ipvs-deadlock-fix patch and RedHat ES 4
From: Sébastien BONNET <sebastien.bonnet@xxxxxxxxxxx>
Date: Mon, 28 Nov 2005 18:12:30 +0100
It looks like I need to apply this patch to the kernel,
http://lkml.org/lkml/2004/11/24/375 ... which has been included in the
kernel.org kernels.


... if your oops really is related to the bug report you've mentioned
before.

It is ! I had these kernels panics fixed using the mentionned patch (attached), which is NOT in 2.6.10 (at least RH's 2.6.10)

--
Sébastien BONNET     --    Ingénieur système
Tel: 04.42.25.15.40      GSM: 06.64.44.58.98
--- net/ipv4/ipvs/ip_vs_ctl.c.orig      2005-11-28 09:52:56.600980091 +0100
+++ net/ipv4/ipvs/ip_vs_ctl.c   2005-11-28 09:52:56.487996245 +0100
@@ -26,7 +26,7 @@
 #include <linux/fs.h>
 #include <linux/sysctl.h>
 #include <linux/proc_fs.h>
-#include <linux/timer.h>
+#include <linux/workqueue.h>
 #include <linux/swap.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
@@ -90,7 +90,7 @@
 #endif
 
 /*
- *     update_defense_level is called from timer bh and from sysctl.
+ *     update_defense_level is called from keventd and from sysctl.
  */
 static void update_defense_level(void)
 {
@@ -212,16 +212,18 @@
 /*
  *     Timer for checking the defense
  */
-static struct timer_list defense_timer;
 #define DEFENSE_TIMER_PERIOD   1*HZ
 
-static void defense_timer_handler(unsigned long data)
+static void defense_work_handler(void *data);
+static DECLARE_WORK(defense_work, defense_work_handler, NULL);
+
+static void defense_work_handler(void *data)
 {
        update_defense_level();
        if (atomic_read(&ip_vs_dropentry))
                ip_vs_random_dropentry();
 
-       mod_timer(&defense_timer, jiffies + DEFENSE_TIMER_PERIOD);
+       schedule_delayed_work(&defense_work, DEFENSE_TIMER_PERIOD);
 }
 
 
@@ -2370,10 +2372,7 @@
        ip_vs_new_estimator(&ip_vs_stats);
 
        /* Hook the defense timer */
-       init_timer(&defense_timer);
-       defense_timer.function = defense_timer_handler;
-       defense_timer.expires = jiffies + DEFENSE_TIMER_PERIOD;
-       add_timer(&defense_timer);
+       schedule_delayed_work(&defense_work, DEFENSE_TIMER_PERIOD);
 
        LeaveFunction(2);
        return 0;
@@ -2384,7 +2383,7 @@
 {
        EnterFunction(2);
        ip_vs_trash_cleanup();
-       del_timer_sync(&defense_timer);
+       cancel_delayed_work(&defense_work);
        ip_vs_kill_estimator(&ip_vs_stats);
        unregister_sysctl_table(sysctl_header);
        proc_net_remove("ip_vs_stats");
--- kernel/workqueue.c.orig     2005-03-28 07:48:51.000000000 +0200
+++ kernel/workqueue.c  2005-11-28 09:51:50.375449122 +0100
@@ -423,6 +423,35 @@
        flush_workqueue(keventd_wq);
 }
 
+/**
+ * cancel_rearming_delayed_workqueue - reliably kill off a delayed
+ *                     work whose handler rearms the delayed work.
+
+ * @wq:   the controlling workqueue structure
+ * @work: the delayed work struct
+ */
+void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq,
+                                       struct work_struct *work)
+{
+       while (!cancel_delayed_work(work))
+               flush_workqueue(wq);
+}
+
+EXPORT_SYMBOL(cancel_rearming_delayed_workqueue);
+
+/**
+ * cancel_rearming_delayed_work - reliably kill off a delayed keventd
+ *                     work whose handler rearms the delayed work.
+ * @work: the delayed work struct
+ */
+void cancel_rearming_delayed_work(struct work_struct *work)
+{
+
+       cancel_rearming_delayed_workqueue(keventd_wq, work);
+}
+EXPORT_SYMBOL(cancel_rearming_delayed_work);
+
+
 int keventd_up(void)
 {
        return keventd_wq != NULL;




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