From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753663AbcB2XNb (ORCPT ); Mon, 29 Feb 2016 18:13:31 -0500 Received: from mail-db3on0093.outbound.protection.outlook.com ([157.55.234.93]:5559 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751179AbcB2XN3 (ORCPT ); Mon, 29 Feb 2016 18:13:29 -0500 Authentication-Results: spf=fail (sender IP is 12.216.194.146) smtp.mailfrom=ezchip.com; ezchip.com; dkim=none (message not signed) header.d=none;ezchip.com; dmarc=none action=none header.from=ezchip.com; From: Chris Metcalf To: Russell King , Thomas Gleixner , Aaron Tomlin , Ingo Molnar , Andrew Morton , Daniel Thompson , , , CC: Chris Metcalf Subject: [PATCH 0/4] improvements to the nmi_backtrace code Date: Mon, 29 Feb 2016 16:40:20 -0500 Message-ID: <1456782024-7122-1-git-send-email-cmetcalf@ezchip.com> X-Mailer: git-send-email 2.1.2 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CPI:12.216.194.146;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(33646002)(5001770100001)(50986999)(85426001)(36756003)(104016004)(42186005)(5008740100001)(5003940100001)(48376002)(81156008)(1096002)(2201001)(4326007)(92566002)(229853001)(5001970100001)(107886002)(6806005)(4001430100002)(106466001)(1220700001)(50226001)(189998001)(47776003)(87936001)(50466002)(105606002)(586003)(2906002)(21314002)(42882005)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM3PR05MB419;H:lab-41.internal.tilera.com;FPR:;SPF:Fail;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;DB3FFO11FD015;1:mvuVxrapslbzbk1vqmT7vwxLOWCcw7zptyV9rnBy59jJx311mSF0jdMv2IoPFYGbjVFln9Zp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Qj+O3sCLAH9cR94KM4Xyo7UbM1OVmlLBAhvE91rur7EhD7vUaU1xsGO7yHqlkapeqR6+uFmPXu48GTESn1X6L32QHEBT0VzgeqMK08n3DV7MzPczREepzAjkg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM3PR05MB419; X-MS-Office365-Filtering-Correlation-Id: 610ea62b-6112-4950-e796-08d34150f3c8 X-MLNXRule-EZCH-Linux: Rule triggered X-MLNXRule-Acc-Dom-4: Rule triggered X-Microsoft-Exchange-Diagnostics: 1;AM3PR05MB419;20:Se6vrpogKJZo1q6IcrsUluzfjYrCdFytMh13/tIMLaONOb639vUF4K0WT2kn7//dS5qpxyub/Sok11vJ5ZDxlNLEY9sqYKQNhcZGveKP3jgqsp7g0+jH9IBT+njfCjlgWUTvxrkrsB63uGp/ZpxgvZZnI8qKok9wVM6bvozZSZKCHRCY7KrOVG4dJ/APt0IeZqyH5Kieznc4fFB3x5AS7uK2SBqoRsNQcMGeEJYBA31WEFZoGHnauq4DqoY25X+Yh/mCoD3Gi/Ct8EUX/vviHQLKJEieC6aPYiTlN7M+lI0+1DNrwJ2XQAXEHvuydXYaFXkYOoGpIIN6dvIIfysz5x1ZZHbj+5wFyD/XOM8+8HKAUgZA9rlft+4Jv0YURIjh+WrYWnOqL9NHtgy3MwLRIk57UusdEp3hOebuT4EnzdaADAC6kWcjtrI9xGj4qN/ppP9veEWHR7oAifNchDEQYmCCA2LjHtDHgyLljSQTsj2zJDDP2jtCNgOzXunKZfi88+1naCoQnj0J1j66XuMOa6BvP5aZTb4I9KUpL9dyGg8oKerkA9u8lFIC/crfo/iHXg8lpLgV7x6eXlHhOTfN0lF78czH9xkwn1xgQbnGjcw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(13015025)(8121501046)(13023025)(13024025)(13017025)(13018025)(10201501046)(3002001);SRVR:AM3PR05MB419;BCL:0;PCL:0;RULEID:;SRVR:AM3PR05MB419; X-Microsoft-Exchange-Diagnostics: 1;AM3PR05MB419;4:/VlmxQkkKsGDoHOdWE6efk7WyxJDdShU+qwXqtvnpfJ3oLoLNOkA/BT6tMjeysw7E3aG+2fb8vAZMaLj/ZWdKoAtqyJCLyom2ORHREiGsJvXlcJeHqbcxe29sbSZDK8zFA2u8RmiInbzmVnMIvErjNDoDQO85MXAH0oD88ktAYtqw9vOyTS2QND36gXmpHssX+hydsEaz+zEDTJ7j214lo3N9AqzSOCP0aC4teG+SbROekHWg+EwJwxlMBMda6nIN9VhCEVOEnraqT8vBFkaHx/o/dcUHPjHErZozFVG0nnJzsqsg5vI4zb+C50nuM28A3WqDDNl2K3yWLUfc+66m+gwFXLLXUCDO4vihpjIob8ZSjd57Px/UWUp1IpW3BRjTRYNjxVXNSv7JnGuix3efGmIL52oYkKqRAg1ZLUyFZLoxFCWcmmkRJtso3cQRa3Hlacs9wP55svDTd30zA36aA== X-Forefront-PRVS: 0867F4F1AA X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;AM3PR05MB419;23:arxLJZQ4w86ZyTC6t6KIa+d6I4MdiN12f9/kRh1wLa?= =?us-ascii?Q?9UlzA79ZboBeFvUbiACicYWWHOxb4bzVPUXDFRy4rmatX9hMwcBVTdXufj+p?= =?us-ascii?Q?kAqaE4Epdz97j+4jti5ZSplExbm0GCVOsyJKUt4MWEzPG5ilq4bMqWMgWbHN?= =?us-ascii?Q?HvijNsPxyPjPziy04mVQkhsrkwOI08Kea7uRhipsx7BpCeE8nXN5pOkUbEou?= =?us-ascii?Q?2lXp0ZIGOe4MTwwF3GY5lAxB46730nK9z15cPYHKxCz9lwUO2UoRf1jOgFpm?= =?us-ascii?Q?8D8i7aeq5paE9wnaAld4z5X+r3GAv8Hs3sHF1EdypR6CfnYztLQjgAMgBbgV?= =?us-ascii?Q?0V1gWJrG3fTJjGBUvlBOjODdIBwTnnA/cMm/Xuy1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+PYcuFTZPYFqkjrHFzdZkB9PkhFmWmPLHuMOttK8x6KL8pwTUIBis4F85/Yth7+wFn80wVsmlc+IiquCrt9h44lA= X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Feb 2016 21:40:32.8378 (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=[lab-41.internal.tilera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR05MB419 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series modifies the trigger_xxx_backtrace() NMI-based remote backtracing code to make it more flexible, and makes a few small improvements along the way. The motivation comes from the task isolation code, where there are scenarios where we want to be able to diagnose a case where some cpu is about to interrupt a task-isolated cpu. It can be helpful to see both where the interrupting cpu is, and also an approximation of where the cpu that is being interrupted is. The nmi_backtrace framework allows us to discover the stack of the interrupted cpu. The first change adds support for trigger_single_cpu_backtrace(), and as an "API side-effect", trigger_cpumask_backtrace(). The underlying abstraction is changed to use cpumasks instead of a "bool except_self". The second and third changes provide small improvements to the behavior of the existing nmi_backtrace code: omitting full backtrace dumps for idle cores, and doing local dump_stack backtraces when we try to do a "remote" dump of the local core. Some of this reflects changes from integrating the arch/tile code into the generic code. The fourth change hooks the arch/tile backtrace mechanism into the nmi_backtrace code to share code and take advantage of other improvements of nmi_backtrace not present in the original arch/tile code, like co-opting printk to use local buffers instead of just spewing to the console and hoping for the best. The changes have been runtime tested on tile, and build-tested on x86 and arm. Chris Metcalf (4): nmi_backtrace: add more trigger_*_cpu_backtrace() methods nmi_backtrace: generate one-line reports for idle cpus nmi_backtrace: do a local dump_stack() instead of a self-NMI arch/tile: adopt the new nmi_backtrace framework arch/arm/include/asm/irq.h | 4 +-- arch/arm/kernel/smp.c | 13 ++------ arch/tile/include/asm/irq.h | 4 +-- arch/tile/kernel/pmc.c | 3 -- arch/tile/kernel/process.c | 72 ++++++++++--------------------------------- arch/tile/kernel/traps.c | 7 +++-- arch/x86/include/asm/irq.h | 4 +-- arch/x86/kernel/apic/hw_nmi.c | 6 ++-- include/linux/nmi.h | 63 +++++++++++++++++++++++++++++-------- lib/nmi_backtrace.c | 48 ++++++++++++++++++++--------- 10 files changed, 116 insertions(+), 108 deletions(-) -- 2.1.2