From: Ingo Molnar <mingo@elte.hu>
To: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Cc: vgoyal@redhat.com, rostedt@goodmis.org,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
lkml <linux-kernel@vger.kernel.org>
Subject: Re: ftrace and kexec
Date: Tue, 19 Feb 2008 15:22:39 +0100 [thread overview]
Message-ID: <20080219142239.GE9965@elte.hu> (raw)
In-Reply-To: <20080219132746.GC13780@linux.vnet.ibm.com>
* Dhaval Giani <dhaval@linux.vnet.ibm.com> wrote:
> Hi,
>
> I've been running ftrace on the sched-devel tree. I just built a
> kernel and tried rebooting using kexec and I get this,
hm, it's not a good idea to keep using the data structures of the tracer
while we kexec. Does the patch below resolve the problem?
Ingo
-------------------------->
Subject: x86: patches/ftrace-kexec-fix.patch
From: Ingo Molnar <mingo@elte.hu>
Date: Tue Feb 19 15:13:56 CET 2008
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/machine_kexec_32.c | 4 ++++
arch/x86/kernel/machine_kexec_64.c | 4 ++++
include/linux/ftrace.h | 7 +++++++
3 files changed, 15 insertions(+)
Index: linux/arch/x86/kernel/machine_kexec_32.c
===================================================================
--- linux.orig/arch/x86/kernel/machine_kexec_32.c
+++ linux/arch/x86/kernel/machine_kexec_32.c
@@ -11,6 +11,8 @@
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/numa.h>
+#include <linux/ftrace.h>
+
#include <asm/pgtable.h>
#include <asm/pgalloc.h>
#include <asm/tlbflush.h>
@@ -107,6 +109,8 @@ NORET_TYPE void machine_kexec(struct kim
unsigned long page_list[PAGES_NR];
void *control_page;
+ tracer_disable();
+
/* Interrupts aren't acceptable while we reboot */
local_irq_disable();
Index: linux/arch/x86/kernel/machine_kexec_64.c
===================================================================
--- linux.orig/arch/x86/kernel/machine_kexec_64.c
+++ linux/arch/x86/kernel/machine_kexec_64.c
@@ -11,6 +11,8 @@
#include <linux/string.h>
#include <linux/reboot.h>
#include <linux/numa.h>
+#include <linux/ftrace.h>
+
#include <asm/pgtable.h>
#include <asm/tlbflush.h>
#include <asm/mmu_context.h>
@@ -184,6 +186,8 @@ NORET_TYPE void machine_kexec(struct kim
unsigned long page_list[PAGES_NR];
void *control_page;
+ tracer_disable();
+
/* Interrupts aren't acceptable while we reboot */
local_irq_disable();
Index: linux/include/linux/ftrace.h
===================================================================
--- linux.orig/include/linux/ftrace.h
+++ linux/include/linux/ftrace.h
@@ -68,6 +68,13 @@ extern void ftrace_call(void);
extern void mcount_call(void);
#endif
+static inline void tracer_disable(void)
+{
+#ifdef CONFIG_FTRACE
+ ftrace_enabled = 0;
+#endif
+}
+
#ifdef CONFIG_FRAME_POINTER
/* TODO: need to fix this for ARM */
# define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
next prev parent reply other threads:[~2008-02-19 14:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-19 13:27 Dhaval Giani
2008-02-19 14:22 ` Ingo Molnar [this message]
2008-02-19 17:00 ` Dhaval Giani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080219142239.GE9965@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=dhaval@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=vgoyal@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®