[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090827031909.4534.24859.sendpatchset@localhost.localdomain>
Date: Wed, 26 Aug 2009 23:16:42 -0400
From: Amerigo Wang <amwang@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: tony.luck@...el.com, linux-ia64@...r.kernel.org,
Neil Horman <nhorman@...hat.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
kamezawa.hiroyu@...fujitsu.com, Andi Kleen <andi@...stfloor.org>,
Michael Ellerman <michael@...erman.id.au>,
Amerigo Wang <amwang@...hat.com>,
"M. Mohan Kumar" <mohan@...ibm.com>, akpm@...ux-foundation.org,
bernhard.walle@....de, Fenghua Yu <fenghua.yu@...el.com>,
Ingo Molnar <mingo@...e.hu>,
Anton Vorontsov <avorontsov@...mvista.com>
Subject: [Patch 6/8] powerpc: implement crashkernel=auto
Since in patch 2/8 we already implement the generic part, this will
add the rest part for powerpc.
Signed-off-by: WANG Cong <amwang@...hat.com>
Cc: Anton Vorontsov <avorontsov@...mvista.com>
Cc: M. Mohan Kumar <mohan@...ibm.com>
Cc: Michael Ellerman <michael@...erman.id.au>
---
Index: linux-2.6/arch/powerpc/include/asm/kexec.h
===================================================================
--- linux-2.6.orig/arch/powerpc/include/asm/kexec.h
+++ linux-2.6/arch/powerpc/include/asm/kexec.h
@@ -39,6 +39,45 @@ typedef void (*crash_shutdown_t)(void);
#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_AUTO_RESERVE
+
+#ifndef KEXEC_AUTO_THRESHOLD
+#define KEXEC_AUTO_THRESHOLD (1ULL<<31) /* 2G */
+#endif
+
+#ifndef arch_default_crash_base
+static inline
+unsigned long long arch_default_crash_base(void)
+{
+ return KDUMP_KERNELBASE;
+}
+#define arch_default_crash_base arch_default_crash_base
+#endif
+
+#ifndef arch_default_crash_size
+static inline
+unsigned long long arch_default_crash_size(unsigned long long total_size)
+{
+ if (total_size < KEXEC_AUTO_THRESHOLD)
+ return 0;
+ if (total_size < (1ULL<<32))
+ return 1ULL<<27;
+ else {
+#ifdef CONFIG_64BIT
+ if (total_size > (1ULL<<37)) /* 128G */
+ return 1ULL<<32; /* 4G */
+ return 1ULL<<ilog2(roundup(total_size/32, 1ULL<<21));
+#else
+ return 1ULL<<28;
+#endif
+ }
+}
+#define arch_default_crash_size arch_default_crash_size
+#endif
+
+#endif
+#include <asm-generic/kexec.h>
+
/*
* This function is responsible for capturing register states if coming
* via panic or invoking dump using sysrq-trigger.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists