Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=311f594dec9b0c8693ec7df75b82c251b6b0e7c2
Commit:     311f594dec9b0c8693ec7df75b82c251b6b0e7c2
Parent:     ae67e498a54259364f7211e10d9834575b340b21
Author:     Jay Lan <[EMAIL PROTECTED]>
AuthorDate: Tue Apr 3 17:53:42 2007 -0700
Committer:  Tony Luck <[EMAIL PROTECTED]>
CommitDate: Mon May 14 15:55:39 2007 -0700

    [IA64] kdump on INIT needs multi-nodes sync-up (v.2)
    
    The current implementation of kdump on INIT events would enter
    kdump processing on DIE_INIT_MONARCH_ENTER and DIE_INIT_SLAVE_ENTER
    events. Thus, the monarch cpu would go ahead and boot up the kdump
    
    On SN shub2 systems, this out-of-sync situation causes some slave
    cpus on different nodes to enter POD.
    
    This patch moves kdump entry points to DIE_INIT_MONARCH_LEAVE and
    DIE_INIT_SLAVE_LEAVE. It also sets kdump_in_progress variable in
    the DIE_INIT_MONARCH_PROCESS event to not dump all active stack
    traces to the console in the case of kdump.
    
    I have tested this patch on an SN machine and a HP RX2600.
    
    Signed-off-by: Jay Lan <[EMAIL PROTECTED]>
    Acked-by: Zou Nan hai <[EMAIL PROTECTED]>
    Signed-off-by: Tony Luck <[EMAIL PROTECTED]>
---
 arch/ia64/kernel/crash.c |   22 +++++++++++++++-------
 arch/ia64/kernel/mca.c   |    4 ++++
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c
index e80c82c..1d64ef4 100644
--- a/arch/ia64/kernel/crash.c
+++ b/arch/ia64/kernel/crash.c
@@ -156,24 +156,30 @@ kdump_init_notifier(struct notifier_block *self, unsigned 
long val, void *data)
        if (!kdump_on_init)
                return NOTIFY_DONE;
 
-       if (val != DIE_INIT_MONARCH_ENTER &&
-           val != DIE_INIT_SLAVE_ENTER &&
+       if (val != DIE_INIT_MONARCH_LEAVE &&
+           val != DIE_INIT_SLAVE_LEAVE &&
+           val != DIE_INIT_MONARCH_PROCESS &&
            val != DIE_MCA_RENDZVOUS_LEAVE &&
            val != DIE_MCA_MONARCH_LEAVE)
                return NOTIFY_DONE;
 
        nd = (struct ia64_mca_notify_die *)args->err;
        /* Reason code 1 means machine check rendezvous*/
-       if ((val == DIE_INIT_MONARCH_ENTER || val == DIE_INIT_SLAVE_ENTER) &&
-                nd->sos->rv_rc == 1)
+       if ((val == DIE_INIT_MONARCH_LEAVE || val == DIE_INIT_SLAVE_LEAVE
+           || val == DIE_INIT_MONARCH_PROCESS) && nd->sos->rv_rc == 1)
                return NOTIFY_DONE;
 
        switch (val) {
-               case DIE_INIT_MONARCH_ENTER:
+               case DIE_INIT_MONARCH_PROCESS:
+                       atomic_set(&kdump_in_progress, 1);
+                       *(nd->monarch_cpu) = -1;
+                       break;
+               case DIE_INIT_MONARCH_LEAVE:
                        machine_kdump_on_init();
                        break;
-               case DIE_INIT_SLAVE_ENTER:
-                       unw_init_running(kdump_cpu_freeze, NULL);
+               case DIE_INIT_SLAVE_LEAVE:
+                       if (atomic_read(&kdump_in_progress))
+                               unw_init_running(kdump_cpu_freeze, NULL);
                        break;
                case DIE_MCA_RENDZVOUS_LEAVE:
                        if (atomic_read(&kdump_in_progress))
@@ -215,8 +221,10 @@ static ctl_table sys_table[] = {
 static int
 machine_crash_setup(void)
 {
+       /* be notified before default_monarch_init_process */
        static struct notifier_block kdump_init_notifier_nb = {
                .notifier_call = kdump_init_notifier,
+               .priority = 1,
        };
        int ret;
        if((ret = register_die_notifier(&kdump_init_notifier_nb)) != 0)
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index 26814de..93e82e4 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -1477,6 +1477,10 @@ default_monarch_init_process(struct notifier_block 
*self, unsigned long val, voi
        struct task_struct *g, *t;
        if (val != DIE_INIT_MONARCH_PROCESS)
                return NOTIFY_DONE;
+#ifdef CONFIG_KEXEC
+       if (atomic_read(&kdump_in_progress))
+               return NOTIFY_DONE;
+#endif
 
        /*
         * FIXME: mlogbuf will brim over with INIT stack dumps.
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to