linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: tip-bot for Andy Lutomirski <tipbot@zytor.com>
Cc: linux-tip-commits@vger.kernel.org, luto@kernel.org,
	hpa@zytor.com, mingo@kernel.org, dvlasenk@redhat.com,
	linux-kernel@vger.kernel.org, jann@thejh.net,
	peterz@infradead.org, torvalds@linux-foundation.org,
	brgerst@gmail.com, tglx@linutronix.de, bp@alien8.de
Subject: Re: [tip:x86/asm] x86/dumpstack: Pin the target stack when dumping it
Date: Fri, 16 Sep 2016 06:55:57 -0500	[thread overview]
Message-ID: <20160916115557.xsgxgjeefnsrrpct@treble> (raw)
In-Reply-To: <tip-1959a60182f48879635812a03a99c02231ea8677@git.kernel.org>

On Fri, Sep 16, 2016 at 02:17:46AM -0700, tip-bot for Andy Lutomirski wrote:
> Commit-ID:  1959a60182f48879635812a03a99c02231ea8677
> Gitweb:     http://git.kernel.org/tip/1959a60182f48879635812a03a99c02231ea8677
> Author:     Andy Lutomirski <luto@kernel.org>
> AuthorDate: Thu, 15 Sep 2016 22:45:45 -0700
> Committer:  Ingo Molnar <mingo@kernel.org>
> CommitDate: Fri, 16 Sep 2016 09:18:53 +0200
> 
> x86/dumpstack: Pin the target stack when dumping it
> 
> Specifically, pin the stack in save_stack_trace_tsk() and
> show_trace_log_lvl().
> 
> This will prevent a crash if the target task dies before or while
> dumping its stack once we start freeing task stacks early.

This causes a hang:

# echo 1 > /proc/sys/kernel/sysrq
# echo l > /proc/sysrq-trigger
[   26.553593] sysrq: SysRq : Show backtrace of all active CPUs
[   26.554130] Sending NMI to all CPUs:
[   26.554521] BAD LUCK: lost 2225 message(s) from NMI context!
[   26.554521] NMI backtrace for cpu 0
[   26.554521] CPU: 0 PID: 783 Comm: bash Not tainted 4.8.0-rc6+ #3
[   26.554522] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.1-1.fc24 04/01/2014
[   26.554522] task: ffff880074fbd480 task.stack: ffffc90000bcc000
[   26.554522] RIP: 0010:[<ffffffff81071526>]  [<ffffffff81071526>] native_write_msr+0x6/0x30
[   26.554523] RSP: 0018:ffffc90000bcfd18  EFLAGS: 00000046
[   26.554523] RAX: 0000000000000400 RBX: ffffffff81f83b20 RCX: 0000000000000830
[   26.554523] RDX: 0000000000000000 RSI: 0000000000000400 RDI: 0000000000000830
[   26.554523] RBP: ffffc90000bcfd20 R08: ffffffffffffffff R09: 0000000000000003
[   26.554524] R10: ffffffff81e5d1a0 R11: 0000000000000001 R12: 0000000000080000
[   26.554524] R13: 0000000000000000 R14: 000000000000a13c R15: 0000000000000000
[   26.554524] FS:  00007f0c7b8a2700(0000) GS:ffff88007d200000(0000) knlGS:0000000000000000
[   26.554525] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   26.554525] CR2: 00007f0c7b8a7000 CR3: 0000000074fff000 CR4: 00000000001406f0
[   26.554525] Stack:
[   26.554525] BUG: unable to handle kernel paging request at 00000000000025d0
[   26.554526] IP: [<ffffffff81039ba8>] show_stack_log_lvl+0x28/0x240
[   26.554526] PGD 718d3067 PUD 718d2067 PMD 0 
[   26.554526] Oops: 0000 [#1] PREEMPT SMP
[   26.554527] Modules linked in: ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack cfg80211 rfkill ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack snd_hda_codec_generic iptable_mangle iptable_security iptable_raw ppdev crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel snd_hda_intel snd_hda_codec serio_raw snd_hwdep snd_hda_core virtio_console virtio_balloon snd_pcm snd_timer snd virtio_net soundcore i2c_piix4 parport_pc parport virtio_blk ata_generic qxl drm_kms_helper ttm pata_acpi drm virtio_pci virtio_ring virtio
[   26.554528] CPU: 0 PID: 783 Comm: bash Not tainted 4.8.0-rc6+ #3
[   26.554528] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.1-1.fc24 04/01/2014
[   26.554528] task: ffff880074fbd480 task.stack: ffffc90000bcc000
[   26.554528] RIP: 0010:[<ffffffff81039ba8>]  [<ffffffff81039ba8>] show_stack_log_lvl+0x28/0x240
[   26.554529] RSP: 0018:ffff88007d205d40  EFLAGS: 00010046
[   26.554529] RAX: 0000000000000000 RBX: ffff88007d205ef8 RCX: 0000000000000000
[   26.554529] RDX: 0000000000000000 RSI: ffff88007d205ef8 RDI: 0000000000000000
[   26.554530] RBP: ffff88007d205d98 R08: ffffffff81c35ef4 R09: 0000000000000005
[   26.554530] R10: ffff880074fbd480 R11: ffff88007d3ce637 R12: ffffffff81071501
[   26.554530] R13: ffff88007d205ef8 R14: 000000062ec39e9f R15: ffff88007d205ef8
[   26.554530] FS:  00007f0c7b8a2700(0000) GS:ffff88007d200000(0000) knlGS:0000000000000000
[   26.554531] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   26.554531] CR2: 00000000000025d0 CR3: 0000000074fff000 CR4: 00000000001406f0
[   26.554531] Stack:
[   26.554531] BUG: unable to handle kernel paging request at 00000000000025d0
[   26.554532] IP: [<ffffffff81039ba8>] show_stack_log_lvl+0x28/0x240
[   26.554532] PGD 718d3067 PUD 718d2067 PMD 0 
[   26.554532] Oops: 0000 [#2] PREEMPT SMP
[   26.554533] Modules linked in: ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack cfg80211 rfkill ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack snd_hda_codec_generic iptable_mangle iptable_security iptable_raw ppdev crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel snd_hda_intel snd_hda_codec serio_raw snd_hwdep snd_hda_core virtio_console virtio_balloon snd_pcm snd_timer snd virtio_net soundcore i2c_piix4 parport_pc parport virtio_blk ata_generic qxl drm_kms_helper ttm pata_acpi drm virtio_pci virtio_ring virtio
[   26.554533] CPU: 0 PID: 783 Comm: bash Not tainted 4.8.0-rc6+ #3
[   26.554534] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.1-1.fc24 04/01/2014
[   26.554534] task: ffff880074fbd480 task.stack: ffffc90000bcc000
[   26.554534] RIP: 0010:[<ffffffff81039ba8>]  [<ffffffff81039ba8>] show_stack_log_lvl+0x28/0x240
[   26.554535] RSP: 0018:ffff88007d205a28  EFLAGS: 00010046
[   26.554535] RAX: 0000000000000000 RBX: ffff88007d205c98 RCX: 0000000000000000
[   26.554535] RDX: 0000000000000000 RSI: ffff88007d205c98 RDI: 0000000000000000
[   26.554535] RBP: ffff88007d205a80 R08: ffffffff81c35ef4 R09: 0000000000000005
[   26.554536] R10: ffff880074fbd480 R11: ffff88007d3ced4e R12: 0000000000000000
[   26.554536] R13: ffff88007d205c98 R14: 0000000000000000 R15: ffff88007d205c98
[   26.554536] FS:  00007f0c7b8a2700(0000) GS:ffff88007d200000(0000) knlGS:0000000000000000
[   26.554536] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   26.554537] CR2: 00000000000025d0 CR3: 0000000074fff000 CR4: 00000000001406f0
[   26.554537] Stack:
[   26.554537] BUG: unable to handle kernel paging request at 00000000000025d0
[   26.554537] IP: [<ffffffff81039ba8>] show_stack_log_lvl+0x28/0x240
[   26.554538] PGD 718d3067 PUD 718d2067 PMD 0 
[   26.554538] Oops: 0000 [#3] PREEMPT SMP
[   26.554539] Modules linked in: ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack cfg80211 rfkill ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack snd_hda_codec_generic iptable_mangle iptable_security iptable_raw ppdev crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel snd_hda_intel snd_hda_codec serio_raw snd_hwdep snd_hda_core virtio_console virtio_balloon snd_pcm snd_timer snd virtio_net soundcore i2c_piix4 parport_pc parport virtio_blk ata_generic qxl drm_kms_helper ttm pata_acpi drm virtio_pci virtio_ring virtio
[   26.554539] CPU: 0 PID: 783 Comm: bash Not tainted 4.8.0-rc6+ #3
[   26.554539] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.1-1.fc24 04/01/2014
[   26.554540] task: ffff880074fbd480 task.stack: ffffc90000bcc000
[   26.554540] RIP: 0010:[<ffffffff81039ba8>]  [<ffffffff81039ba8>] show_stack_log_lvl+0x28/0x240
[   26.554540] RSP: 0018:ffff88007d205708  EFLAGS: 00010046
[   26.554540] RAX: 0000000000000000 RBX: ffff88007d205978 RCX: 0000000000000000
[   26.554541] RDX: 0000000000000000 RSI: ffff88007d205978 RDI: 0000000000000000
[   26.554541] RBP: ffff88007d205760 R08: ffffffff81c35ef4 R09: 0000000000000005
[   26.554541] R10: ffff880074fbd480 R11: ffff88007d3cf465 R12: 0000000000000000
[   26.554542] R13: ffff88007d205978 R14: 0000000000000000 R15: ffff88007d205978
[   26.554542] FS:  00007f0c7b8a2700(0000) GS:ffff88007d200000(0000) knlGS:0000000000000000
[   26.554542] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   26.554542] CR2: 00000000000025d0 CR3: 0000000074fff000 CR4: 00000000001406f0
[   26.554542] Stack:
[   26.554543] BUG: unable to handle kernel paging request at 00000000000025d0
[   26.554543] IP: [<ffffffff81039ba8>] show_stack_log_lvl+0x28/0x240
[   26.554543] PGD 718d3067 PUD 718d2067 PMD 0 
[   26.554543] Oops: 0000 [#4] PREEMPT SMP
[   26.554545] Modules linked in: ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack cfg80211 rfkill ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack snd_hda_codec_generic iptable_mangle iptable_security iptable_raw ppdev crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel snd_hda_intel snd_hda_codec serio_raw snd_hwdep snd_hda_core virtio_console virtio_balloon snd_pcm snd_timer snd virtio_net soundcore i2c_piix4 parport_pc parport virtio_blk ata_generic qxl drm_kms_helper ttm pata_acpi drm virtio_pci virtio_ring virtio
[   26.554545] CPU: 0 PID: 783 Comm: bash Not tainted 4.8.0-rc6+ #3
[   26.554545] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.1-1.fc24 04/01/2014
[   26.554545] task: ffff880074fbd480 task.stack: ffffc90000bcc000
[   26.554546] RIP: 0010:[<ffffffff81039ba8>]  [<ffffffff81039ba8>] show_stack_log_lvl+0x28/0x240
[   26.554546] RSP: 0018:ffff88007d2053e8  EFLAGS: 00010046
[   26.554546] RAX: 0000000000000000 RBX: ffff88007d205658 RCX: 0000000000000000
[   26.554546] RDX: 0000000000000000 RSI: ffff88007d205658 RDI: 0000000000000000
[   26.554547] RBP: ffff88007d205440 R08: ffffffff81c35ef4 R09: 0000000000000005
[   26.554547] R10: ffff880074fbd480 R11: ffff88007d3cfb7c R12: 0000000000000000
[   26.554547] R13: ffff88007d205658 R14: 0000000000000000 R15: ffff88007d205658
[   26.554547] FS:  00007f0c7b8a2700(0000) GS:ffff88007d200000(0000) knlGS:0000000000000000
[   26.554548] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   26.554548] CR2: 00000000000025d0 CR3: 0000000074fff000 CR4: 00000000001406f0
[   26.554548] Stack:
[   26.554549] BUG:
[   26.554632] Kernel Offset: disabled


-- 
Josh

  reply	other threads:[~2016-09-16 11:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-16  5:45 [PATCH v2 0/8] thread_info cleanups and stack caching Andy Lutomirski
2016-09-16  5:45 ` [PATCH v2 1/8] x86/entry/64: Fix a minor comment rebase error Andy Lutomirski
2016-09-16  9:16   ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2016-09-16  5:45 ` [PATCH v2 2/8] sched: Add try_get_task_stack() and put_task_stack() Andy Lutomirski
2016-09-16  9:16   ` [tip:x86/asm] sched/core: " tip-bot for Andy Lutomirski
2016-09-16  5:45 ` [PATCH v2 3/8] kthread: to_live_kthread() needs try_get_task_stack() Andy Lutomirski
2016-09-16  9:17   ` [tip:x86/asm] kthread: Pin the stack via try_get_task_stack()/put_task_stack() in to_live_kthread() function tip-bot for Oleg Nesterov
2016-09-16  5:45 ` [PATCH v2 4/8] x86/dumpstack: Pin the target stack when dumping it Andy Lutomirski
2016-09-16  9:17   ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2016-09-16 11:55     ` Josh Poimboeuf [this message]
2016-09-16 12:28       ` Josh Poimboeuf
2016-09-16 12:57         ` Ingo Molnar
2016-09-16 13:05           ` [PATCH] x86/dumpstack: remove NULL task pointer convention Josh Poimboeuf
2016-09-16  5:45 ` [PATCH v2 5/8] x86/process: Pin the target stack in get_wchan() Andy Lutomirski
2016-09-16  9:18   ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2016-09-16  5:45 ` [PATCH v2 6/8] lib/syscall: Pin the task stack in collect_syscall() Andy Lutomirski
2016-09-16  9:18   ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2016-09-16  5:45 ` [PATCH v2 7/8] sched: Free the stack early if CONFIG_THREAD_INFO_IN_TASK Andy Lutomirski
2016-09-16  9:19   ` [tip:x86/asm] sched/core: " tip-bot for Andy Lutomirski
2016-09-16  5:45 ` [PATCH v2 8/8] fork: Cache two thread stacks per cpu if CONFIG_VMAP_STACK is set Andy Lutomirski
2016-09-16  9:19   ` [tip:x86/asm] fork: Optimize task creation by caching two thread stacks per CPU if CONFIG_VMAP_STACK=y tip-bot for Andy Lutomirski

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=20160916115557.xsgxgjeefnsrrpct@treble \
    --to=jpoimboe@redhat.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=dvlasenk@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jann@thejh.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tipbot@zytor.com \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).