[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <451140D3.2050301@hitachi.com>
Date: Wed, 20 Sep 2006 22:23:31 +0900
From: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To: Alan Cox <alan@...rguk.ukuu.org.uk>
Cc: Helge Hafting <helge.hafting@...el.hist.no>, prasanna@...ibm.com,
Martin Bligh <mbligh@...gle.com>,
Andrew Morton <akpm@...l.org>,
"Frank Ch. Eigler" <fche@...hat.com>, Ingo Molnar <mingo@...e.hu>,
Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>,
Paul Mundt <lethal@...ux-sh.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Jes Sorensen <jes@....com>, Tom Zanussi <zanussi@...ibm.com>,
Richard J Moore <richardj_moore@...ibm.com>,
Michel Dagenais <michel.dagenais@...ymtl.ca>,
Christoph Hellwig <hch@...radead.org>,
Greg Kroah-Hartman <gregkh@...e.de>,
Thomas Gleixner <tglx@...utronix.de>,
William Cohen <wcohen@...hat.com>, ltt-dev@...fik.org,
systemtap@...rces.redhat.com
Subject: Re: [PATCH] Linux Kernel Markers
Hi,
Alan Cox wrote:
> Ar Mer, 2006-09-20 am 11:39 +0200, ysgrifennodd Helge Hafting:
>> How about this workaround:
>> 1. Overwrite the start of the function with a hlt, which is atomic.
>> 2. Write that 5-byte jump after the hlt.
>> 3. Overwrite the hlt with nop so things will work
>> 4. interrupt any cpus that got stuck on the hlt - or just wait for the
>> timer.
>
> CPU errata time again. You have to synchronize.
Sure, and the djprobe which I had developed method can treat it as below;
1. Overwrite the 1st instruction with int3. (atomic)
2. Wait until all processes running on every cpus are scheduled.
(I'm using synchronize_sched(). This step ensures no-one exist on
the instructions which will be overwritten by the dest-addr)
3. Write the destination address
4. Interrupt any cpus to serialize those caches (using CPUID).
5. Overwrite the int3 with jmp opcode. (atomic)
In this method, the instructions are updated like below;
0. [ insn1 ][ insn2]
1. [int3]1 ][ insn2]
2. wait
3. [int3][ destaddr]
4. sync
5. [jmp to destaddr]
Actually, #2 is not enough for the preemptive kernel. So, current
djprobe doesn't support CONFIG_PREEMPT. But Ingo proposed some
good ideas (use freeze_processes()). I'll try his ideas.
What would you think about djprobe's method?
Thanks,
--
Masami HIRAMATSU
2nd Research Dept.
Hitachi, Ltd., Systems Development Laboratory
E-mail: masami.hiramatsu.pt@...achi.com
-
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