[Devel] [PATCH RHEL7 COMMIT] fence-watchdog: return back message printing about fencing

Konstantin Khorenko khorenko at virtuozzo.com
Fri Sep 16 08:08:27 PDT 2016


The commit is pushed to "branch-rh7-3.10.0-327.28.2.vz7.17.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.28.2.vz7.17.6
------>
commit c5139843dd3bde74bd1e2b1065669fe20985b8c3
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date:   Fri Sep 16 19:08:27 2016 +0400

    fence-watchdog: return back message printing about fencing
    
    Use stock panic for crash and schedule work for reboot:
    
    We've temporary stopped printing the message about fencing
    as that caused problems in video card driver which needs to
    vmalloc but can not do so in_interrupt() context.(reproduces
    rarely 1/10 when triger fence watchdog from net_rx_action)
    
    So now we try to use stock panic's print to deliver message
    about fencing in kernel log.(checked 20 times - no reproduce)
    
    Also we need to print message for reboot action, for that matter
    we can schedule work for it same as for poweroff action as all
    outgoing network packets will be droped after time exhausted.
    
    Pity that when call panic we will not get modules list as in
    oops, all other relevant info seem to stay in current output.
    
    https://jira.sw.ru/browse/PSBM-50006
    
    Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
    Acked-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 kernel/fence-watchdog.c | 31 +++++++++++++------------------
 1 file changed, 13 insertions(+), 18 deletions(-)

diff --git a/kernel/fence-watchdog.c b/kernel/fence-watchdog.c
index 622cd53..f5c2347f 100644
--- a/kernel/fence-watchdog.c
+++ b/kernel/fence-watchdog.c
@@ -42,36 +42,31 @@ DEFINE_VVAR(volatile unsigned long, fence_wdog_jiffies64) = MAX_U64;
 static int fence_wdog_action = FENCE_WDOG_CRASH;
 static atomic_t not_fenced = ATOMIC_INIT(-1);
 
-static void do_halt(struct work_struct *dummy)
+static void do_halt_or_reboot(struct work_struct *dummy)
 {
 	printk(KERN_EMERG"fence-watchdog: %s\n",
 	       action_names[fence_wdog_action]);
-	kernel_halt();
-}
-
-static DECLARE_WORK(halt_work, do_halt);
-
-void fence_wdog_do_fence(void)
-{
-	char *killer = NULL;
-
 	switch (fence_wdog_action) {
-	case FENCE_WDOG_CRASH:
-		panic_on_oops = 1;
-		wmb();
-		*killer = 1;
-		break;
 	case FENCE_WDOG_REBOOT:
-		lockdep_off();
-		local_irq_enable();
 		emergency_restart();
 		break;
 	case FENCE_WDOG_POWEROFF:
-		schedule_work(&halt_work);
+		kernel_halt();
 		break;
 	}
 }
 
+static DECLARE_WORK(halt_or_reboot_work, do_halt_or_reboot);
+
+void fence_wdog_do_fence(void)
+{
+	if (fence_wdog_action == FENCE_WDOG_CRASH)
+		panic("fence-watchdog: %s\n",
+		      action_names[fence_wdog_action]);
+	else
+		schedule_work(&halt_or_reboot_work);
+}
+
 inline int fence_wdog_check_timer(void)
 {
 	if (unlikely(get_jiffies_64() > fence_wdog_jiffies64 &&


More information about the Devel mailing list