Message ID | 1458667179-19630-3-git-send-email-cmetcalf@mellanox.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 38D91C0553 for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 22 Mar 2016 17:22:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 15CE420386 for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 22 Mar 2016 17:22:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 039A920259 for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 22 Mar 2016 17:22:13 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aiPyz-0008LW-U5; Tue, 22 Mar 2016 17:20:41 +0000 Received: from mail-db3on0057.outbound.protection.outlook.com ([157.55.234.57] helo=emea01-db3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aiPyc-0006uC-Tj for linux-arm-kernel@lists.infradead.org; Tue, 22 Mar 2016 17:20:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=+AekgeqcJk5YS7d2VcUueK63fpkOhhT48BOUqPZAsdI=; b=l5o+eWBq/yOLZ0Ba9mfuw+T/MjbQPITXA7y+0SGdrTNIKrNt0snbfaC5qPfy+jCQRe9ewSnPhSLqLlwT2qj07KpVQAR2FUHH+ACyHfsToojhL60JfHVKm/l1iek8sVJjIVHPeCNbTBPAtX7Ta+9ezbaOMijAooVG2Zu02oNPK2Q= Received: from AMXPR05CA0046.eurprd05.prod.outlook.com (10.242.9.174) by HE1PR05MB1692.eurprd05.prod.outlook.com (10.169.119.158) with Microsoft SMTP Server (TLS) id 15.1.443.12; Tue, 22 Mar 2016 17:19:55 +0000 Received: from AM1FFO11FD015.protection.gbl (2a01:111:f400:7e00::166) by AMXPR05CA0046.outlook.office365.com (2a01:111:e400:803c::46) with Microsoft SMTP Server (TLS) id 15.1.443.12 via Frontend Transport; Tue, 22 Mar 2016 17:19:54 +0000 Authentication-Results: spf=fail (sender IP is 12.216.194.146) smtp.mailfrom=ezchip.com; mellanox.com; dkim=none (message not signed) header.d=none; mellanox.com; dmarc=fail action=none header.from=mellanox.com; Received-SPF: Fail (protection.outlook.com: domain of ezchip.com does not designate 12.216.194.146 as permitted sender) receiver=protection.outlook.com; client-ip=12.216.194.146; helo=ld-1.internal.tilera.com; Received: from ld-1.internal.tilera.com (12.216.194.146) by AM1FFO11FD015.mail.protection.outlook.com (10.174.64.93) with Microsoft SMTP Server (TLS) id 15.1.443.6 via Frontend Transport; Tue, 22 Mar 2016 17:19:54 +0000 Received: (from cmetcalf@localhost) by ld-1.internal.tilera.com (8.14.4/8.14.4/Submit) id u2MHJrKa019680; Tue, 22 Mar 2016 13:19:53 -0400 From: Chris Metcalf <cmetcalf@mellanox.com> To: Peter Zijlstra <peterz@infradead.org>, "Rafael J. Wysocki" <rjw@rjwysocki.net>, Russell King <linux@arm.linux.org.uk>, Thomas Gleixner <tglx@linutronix.de>, Aaron Tomlin <atomlin@redhat.com>, Ingo Molnar <mingo@redhat.com>, Andrew Morton <akpm@osdl.org>, Daniel Thompson <daniel.thompson@linaro.org>, <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH v3 2/4] nmi_backtrace: do a local dump_stack() instead of a self-NMI Date: Tue, 22 Mar 2016 13:19:37 -0400 Message-ID: <1458667179-19630-3-git-send-email-cmetcalf@mellanox.com> X-Mailer: git-send-email 2.7.2 In-Reply-To: <1458667179-19630-1-git-send-email-cmetcalf@mellanox.com> References: <1458667179-19630-1-git-send-email-cmetcalf@mellanox.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:12.216.194.146; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(76176999)(50986999)(36756003)(86362001)(85426001)(50466002)(48376002)(42186005)(33646002)(105606002)(4326007)(106466001)(229853001)(189998001)(2906002)(1096002)(107886002)(586003)(1220700001)(5001770100001)(5001970100001)(104016004)(11100500001)(2201001)(4001430100002)(2950100001)(87936001)(50226001)(960300001)(19580395003)(92566002)(47776003)(19580405001)(5008740100001)(6806005)(921003)(1121003)(83996005); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB1692; H:ld-1.internal.tilera.com; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD015; 1:sb7TAi45/WmtCE1q+SelOt+YzlJFisEKzUYLRrUy9LbZzbucu1GzKO1gn+ORPW+E3kSdgMrhBFFq7HiAzCV8BpTyjbUg7Dg+KJ8BAyYAl8qB4Fjn/j5DPFTQmU3zKHMS/O/RD/4q/IIbK9UXBvuS1p6ZOCReG7i429oc7y61SAEQ17AgHEtovb5d6Wu2+yGLLd2ktBCP/Ndnkaxgsdt5JaN5ZRhEhQL6fnzIESGMCVVu1BhFV0UJ7WrZbKryPCLqX3Dc2WEU/vi3zMpDlMxpXyBb6su0KMqdnrcO7FPZaWjVdSoxiZTVLWiG7WPz/E9jk9oWdXdFkUpUPb+OHiP3JHwAEBE/HN0HwCUJFzC5ygHKiQE3kIMEEK/042Mw1Ljt1pJZhVy6QvjgOYPiz4iv1fY8IYh+shGXocf03lcOantcgQ6OsJHCTgvyt6DbVRazxGTlO5RFbJYeivDvo/qPA3s5nce9FY1mUPiHSUF78e/SX7PY4upKyHICR9RO4sOfF5vvWoemnG98nAJlgqujm4uVaQ2tJjdTSg+pAzmoW4jR7JriFRi85ip+MVd9Pjxy MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 4ee4e941-a6b1-49c8-a1c7-08d352762faf X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB1692; 2:tqLd01K8kTvkB+iWk32ulf3Z14NX6SUtGVVAfp1bGvh7ykHaK1eWVYY9lOdUZ8RWfP4SCgPOc3/gLMpbSt8Pgnk8V8d7+DZ/7tf0gwBwn7IQ4zQayekvRkdZGxv347LvEVlWxUcyR79IfbAmI7y2tjR2q2tTzYq4i2RbcoSKpIYmZFjwSZfbrp7JgZO7HYWw; 3:BJq40yq+00RzE52NasGiRSfH1c8EPDZbRsjZi7KICNCTMCzdGZTVtHNuOzzPTvZa5Yk7ORsSpgk4XdFGbZa6ldmpdOTfXpdDQqp6vUDKQYDXoF9S+1Yd2Ali4/gjt3jzZxnK4A2M6ujkORiI4Q0rh+ZeIwLQfu91Lz6CsbQ+yEv1yY7Dfwe21crw/nUq5mmdzHBIZK8L2yjAcoKMup6OKHxRBOHG1b2lzVRxHAvIjlU= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR05MB1692; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB1692; 25:QER0PwHOg1V+TbBi/ESXi/Idm8Jw28rvOTHVsiMmxMxmDd4YmaBuNvdX8AcxnfVs4J1ZBoaBkt178pBjaNzn+C4JwG9qgH2HHlyYM7ddvDd6XF4KgKbnhHkBmde+GEzSfphoIEwEsWVZOHhvWuMvMR2CYpdQjeibN5HMDtd//r+5RKvtgs3Om66Ghe9WQClK4mi9h8NkA3hE48Yix0RjUktv4eqX5wl0vSKjH7ZFyF203CciP8Dt99ADO8EcR8E/JK8Eiz+8KvzNmfO3wdCAWWIBoE0i3abivQnMwOru9Vh9TyaT2pkshW8BmoZHjnynWsVN8Y9DdNTfNMrPLPRBm09sFAz1qz0GkWeK1s3Ye76BZF0ITjN6BEMtGKWvMmnCdjqxybMcgYzhPbCTvOokxpqGe3L4ERVNexUFyM8oFz9cQbCMC7FLccjfJEyyPDFx7/hWkg+I7NvXqVZYJThTxuyR1/R7FhlRCqWckCf+5mKZ6X/UJiiqETOwbF1QdIpVCyHc0s9PPNIfsCgo5gbx8FM3D+UaMysq9BjqL2M/f5TJeIOWSFAAX/csIexaQ/t1 X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB1692; 20:+3HIL+6He/NRhiKxB11aT3dQrflbxaF2YoNfNSbLrZGSxGxjotUu5/qaqXpKV6O7tF9bmB0C267PeqDSnafr8kttX7y+j8XhM2AZgRGCarpTdvYiTpzsh2m2ikSez0tibi1XlugzJszFXVOnRn6NVHpgh9Q8blX3GniI/oN/DHVKEXVb4qhVI7YAjWDcZTMkdUdQNb+8zOf4g2C1YWJVirEognaY+4dX2onitFku+CVkWcO5aZDYEjNFjxNtBDJgGS+1pvgmGKEF4ZM5TT+tzraaFP/onpIhrk70tDKNP6IYKsv1v3sErfZELAZS/MnhhZFEih324lCWgRIFJUpGiOPwMMrsbhyhUsblT40uOxlZKW043BIpipvhwEMMRyE8BWa+m/gdWm/Wv1GWKM5dnho5+GuwRCi4I4tgsz20q6DdmtiiV6ErLn6WF+MbT7NtfuAD7wqtygZPREYD6pMZ1YJxhorWr2VLb5WI9czRN9SLgRSN9h1LPm24/8K/2EBZ X-Microsoft-Antispam-PRVS: <HE1PR05MB16927FD1BB606EE75D5739CAB2800@HE1PR05MB1692.eurprd05.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13023025)(13024025)(13015025)(13017025)(5005006)(13018025)(8121501046)(3002001)(10201501046); SRVR:HE1PR05MB1692; BCL:0; PCL:0; RULEID:; SRVR:HE1PR05MB1692; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB1692; 4:6/xxjJCJAR0iWvAQjxDY/pOI/HvvJ9gzppRRbJnPyhyUAl4jQ7s2wUga8yq66TcWeKFxbdzf4Jq5ktw5GCtZNDTmzChA3AdoC49cyOwsdomD4X8lRpKQtXW+3eDYyNwVCO1sIuvLvSLzU0QkoNOU5WUUNTcbfBW2OJc/t9rOXq83TK9Iia4n6ypdkwqHMFGKnf/c/95tYoTXGY2c1wFXI+QrEeGI1gKz/nuyYC4ylE3cIwq0QPHQ5yZkd1kI/hn9VceIh6O2Kwm9rUu+4J/rUU/YiMSbwPrsPnMQox/pb6EmoO1Eqj7BULXNQVBxMksN1pU6U5fzKa4WcTop1hHEitJGuLuPa2F6bSwMPaOomM2gKup3clPf5csq6Qbk9x3gcVhf4/lA7v755lifn4rSlLt+fUrnj47MXDhucgMbjz/hKog5My7an9E5wm752V3c1o4TjxP/tk+RhgJJUqIiIQ== X-Forefront-PRVS: 08897B549D X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR05MB1692; 23:67Fuv1EvWdihOyVKFTNcn5fRjOx/6SktJvKGq04Vy?= =?us-ascii?Q?kor2FPfVhcboqszBggxEa7xidQQpgx+gGEtfI4T8lnpymyJuEm73VtKJ6boL?= =?us-ascii?Q?jv18Diwn0sRp92K/xVgAZTLgFiYgR8f3Uu5u9LXqh1xrBiuusN64ovZQBLxk?= =?us-ascii?Q?nGCqdn7Hgp9fB7Q2plhjrglQHUSjS66nkOWm0VqZA483h5vPGu5Yxsv5DMqL?= =?us-ascii?Q?V3wVgHiwwMrKBuzQURMKQ6/MX4GxzlE3j1veC+uTBMtBqpGnDaYdzpp3Uzsh?= =?us-ascii?Q?XVIwfuu5yx3ZwQ5Y/xR039bbbK/ZeAEPy+OmMhxmUlmC86ePrAEj+G4WAswJ?= =?us-ascii?Q?uPsm/Nk+43r1wBftquxJm0fYX0UdmqJojOxnhIhupBR47vHfroAZHgMj/Jf3?= =?us-ascii?Q?tsd1Nv3GHQJoKhSD02d3tWMa87K3llZoEzEnZBQILm4uK0VhBEGD/yPTU8YL?= =?us-ascii?Q?FoT3Wyl2dNuUzBvD73UnYurERoM8q5eCX9EFIWHnaNODZmdS3ziZpy0X8cbZ?= =?us-ascii?Q?tSbcSljBMNHKjFAP25YuZ/udqlEz3fSb4V3e5S/c1WsDj+wkeiS4GEgrey5r?= =?us-ascii?Q?BbBtQoBnYp+x2K2BYTfcZdioIvdIlr2jncz8wWFgmopik1rB90VazbBN9niS?= =?us-ascii?Q?2P1fRYdUc6axAybEK0siAOcSeH5CireR1AaM0HznxcDn+HLmkL7xB7tv3HYd?= =?us-ascii?Q?JjqY+0jxH7eT3hNFUeDIoLrzJ2T0ojDNK0N5dXUGEdRSXWWjp/S/D5AE//zM?= =?us-ascii?Q?RPCiQI/GRrxILvF323+kh7pPchEhhK5/8rrs6rHXOY076tb3O8jyL/wYi78b?= =?us-ascii?Q?qJ6ycTMC7RwXCtSme89Sfy7jFrbiGSd4BBpV6ySkFmP4YfbVNwDWbiFdqi3R?= =?us-ascii?Q?1WCgUhh5U6my78z8OENYBHl9JVh7b8vf+2CM3kvVoBogsl8v7TFM76OBdiYJ?= =?us-ascii?Q?hjTasv+bX8oF6pvaybKDp2HLgFTBx/QGzzV6HZSVO3/Ee0Zi5tZNF0CHOjBo?= =?us-ascii?Q?QlyXPhOkrKX422g4D7dg7KVxBZbBFwuYxdq8YgfTfsuIziYcssn2U85yWeSm?= =?us-ascii?Q?cnE14ghDjl1Zo/JEegIvOngZHvXhuCmPTeAHd6qxA1IzBcWsES5EiNYD19xG?= =?us-ascii?Q?k/QaGqI5LYQLfBidzKIdcqQ+1vqzSOt3LtiiW9EPB7g/Jffqh1Ynw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB1692; 5:cluSIPvk+Z8IRaZd06/LWBM12ePdLkmBCt4pFxIdhg1wG55KtVIARPxCHEZY4Ek4ObC/GDPpwcf4+E/tO/vw5jODE7dOpu7oyRRYvs9kn1XW+ZWN2CEMudfIhQEqNThjduc8OvQHlyj/w99HWEfE5w==; 24:TkNvVW1wsZdP4rdfh7ViD4gYLv9Fqo/K+/jzCHW4CmMRVYbvbXCWn4C8sjip++MUPDzNkTuxv5UviNAA4uLtx+geAxBuv8wCcbsFRgJ22fU= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2016 17:19:54.4817 (UTC) X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a652971c-7d2e-4d9b-a6a4-d149256f461b; Ip=[12.216.194.146]; Helo=[ld-1.internal.tilera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB1692 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160322_102019_670043_FBB02572 X-CRM114-Status: GOOD ( 14.96 ) X-Spam-Score: -2.0 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: Chris Metcalf <cmetcalf@mellanox.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,RCVD_IN_DNSWL_MED,T_DKIM_INVALID,T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 208125658e56..26a9ac6bc616 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -746,15 +746,6 @@ core_initcall(register_cpufreq_notifier); static void raise_nmi(cpumask_t *mask) { - /* - * Generate the backtrace directly if we are running in a calling - * context that is not preemptible by the backtrace IPI. Note - * that nmi_cpu_backtrace() automatically removes the current cpu - * from mask. - */ - if (cpumask_test_cpu(smp_processor_id(), mask) && irqs_disabled()) - nmi_cpu_backtrace(NULL); - smp_cross_call(mask, IPI_CPU_BACKTRACE); } diff --git a/lib/nmi_backtrace.c b/lib/nmi_backtrace.c index db63ac75eba0..9375c0279b73 100644 --- a/lib/nmi_backtrace.c +++ b/lib/nmi_backtrace.c @@ -76,6 +76,15 @@ void nmi_trigger_cpumask_backtrace(const cpumask_t *mask, seq_buf_init(&s->seq, s->buffer, NMI_BUF_SIZE); } + /* + * Don't try to send an NMI to this cpu; it may work on some + * architectures, but on others it may not, and we'll get + * information at least as useful just by doing a dump_stack() here. + * Note that nmi_cpu_backtrace(NULL) will clear the cpu bit. + */ + if (cpumask_test_cpu(this_cpu, to_cpumask(backtrace_mask))) + nmi_cpu_backtrace(NULL); + if (!cpumask_empty(to_cpumask(backtrace_mask))) { pr_info("Sending NMI from CPU %d to CPUs %*pbl:\n", this_cpu, nr_cpumask_bits, to_cpumask(backtrace_mask));
Currently on arm there is code that checks whether it should call dump_stack() explicitly, to avoid trying to raise an NMI when the current context is not preemptible by the backtrace IPI. Similarly, the forthcoming arch/tile support uses an IPI mechanism that does not support generating an NMI to self. Accordingly, move the code that guards this case into the generic mechanism, and invoke it unconditionally whenever we want a backtrace of the current cpu. It seems plausible that in all cases, dump_stack() will generate better information than generating a stack from the NMI handler. The register state will be missing, but that state is likely not particularly helpful in any case. Or, if we think it is helpful, we should be capturing and emitting the current register state in all cases when regs == NULL is passed to nmi_cpu_backtrace(). Signed-off-by: Chris Metcalf <cmetcalf@mellanox.com> --- arch/arm/kernel/smp.c | 9 --------- lib/nmi_backtrace.c | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-)