mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: 王龙 <wanglong@laoqinren.net>
To: rostedt <rostedt@goodmis.org>, jkosina <jkosina@suse.cz>,
	paulmck <paulmck@linux.vnet.ibm.com>, pmladek <pmladek@suse.cz>,
	dzickus <dzickus@redhat.com>
Cc: johannes <johannes@sipsolutions.net>, koct9i <koct9i@gmail.com>,
	tglx <tglx@linutronix.de>, mingo <mingo@redhat.com>,
	hpa <hpa@zytor.com>, x86 <x86@kernel.org>,
	atomlin <atomlin@redhat.com>, akpm <akpm@linux-foundation.org>,
	"sasha.levin" <sasha.levin@oracle.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	peifeiyue <peifeiyue@huawei.com>,
	"long.wanglong" <long.wanglong@huawei.com>,
	"morgan.wang" <morgan.wang@huawei.com>
Subject: [RFC] how to perform a safe NMI stack trace on all CPUs on x86?
Date: Wed, 13 May 2015 22:14:54 +0800	[thread overview]
Message-ID: <tencent_2DEC6ECC6194905D15D8E6D5@qq.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 991 bytes --]

Hi all,

In kernel before 3.19, when trigger_all_cpu_backtrace() is called on x86, 
it will trigger an NMI on each CPU and call show_regs(). But this can lead
to a hard lock up if the NMI comes in on another printk().

The commit a9edc88093287183ac934be44f295f183b2c62dd (x86/nmi: Perform a safe 
NMI stack trace on all CPUs) fix this problem on kernel mainline. when the NMI 
triggers, it switches the printk routine for that CPU to call a NMI safe printk 
function that records the printk in a per_cpu seq_buf descriptor. After all 
NMIs have finished recording its data, the seq_bufs are printed in a safe 
context. But how do we fix this problem in older version of kernel(eg, 3.10 stable)? 
The 3.10 stable has no "switch printk routine" and "seq_buf" infrastructures.

Could anyone give me some ideas?

Best Regards
Wang Longÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

             reply	other threads:[~2015-05-13 14:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13 14:14 王龙 [this message]
2015-05-13 14:22 ` Steven Rostedt
2015-05-14 11:15   ` long.wanglong
2015-05-13 14:26 ` Jiri Kosina
2015-05-14 11:20   ` long.wanglong

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=tencent_2DEC6ECC6194905D15D8E6D5@qq.com \
    --to=wanglong@laoqinren.net \
    --cc=akpm@linux-foundation.org \
    --cc=atomlin@redhat.com \
    --cc=dzickus@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jkosina@suse.cz \
    --cc=johannes@sipsolutions.net \
    --cc=koct9i@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=long.wanglong@huawei.com \
    --cc=mingo@redhat.com \
    --cc=morgan.wang@huawei.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peifeiyue@huawei.com \
    --cc=pmladek@suse.cz \
    --cc=rostedt@goodmis.org \
    --cc=sasha.levin@oracle.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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

Powered by JetHome