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

Submitted by Konstantin Khorenko on Sept. 16, 2016, 3:08 p.m.


Message ID 201609161508.u8GF8R9K028153@finist_cl7.x64_64.work.ct
State New
Series "fence-watchdog: return back message printing about fencing"
Headers show

Commit Message

Konstantin Khorenko Sept. 16, 2016, 3:08 p.m.
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@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.
    Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
    Acked-by: Kirill Tkhai <ktkhai@virtuozzo.com>
 kernel/fence-watchdog.c | 31 +++++++++++++------------------
 1 file changed, 13 insertions(+), 18 deletions(-)

Patch hide | download patch | download mbox

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",
-	kernel_halt();
-static DECLARE_WORK(halt_work, do_halt);
-void fence_wdog_do_fence(void)
-	char *killer = NULL;
 	switch (fence_wdog_action) {
-		panic_on_oops = 1;
-		wmb();
-		*killer = 1;
-		break;
-		lockdep_off();
-		local_irq_enable();
-		schedule_work(&halt_work);
+		kernel_halt();
+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 &&