Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756737AbcCVRfb (ORCPT ); Tue, 22 Mar 2016 13:35:31 -0400 Received: from mail-am1on0059.outbound.protection.outlook.com ([157.56.112.59]:45698 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755414AbcCVRfT (ORCPT ); Tue, 22 Mar 2016 13:35:19 -0400 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; From: Chris Metcalf To: Peter Zijlstra , "Rafael J. Wysocki" , Russell King , Thomas Gleixner , Aaron Tomlin , Ingo Molnar , Andrew Morton , Daniel Thompson , , , , CC: Chris Metcalf Subject: [PATCH v3 0/4] improvements to the nmi_backtrace code Date: Tue, 22 Mar 2016 13:19:35 -0400 Message-ID: <1458667179-19630-1-git-send-email-cmetcalf@mellanox.com> X-Mailer: git-send-email 2.7.2 In-Reply-To: <20160321214935.GF6344@twins.programming.kicks-ass.net> 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)(105606002)(19580405001)(189998001)(107886002)(5001970100001)(19580395003)(85426001)(229853001)(5003940100001)(92566002)(50226001)(106466001)(87936001)(50986999)(86362001)(2201001)(15975445007)(50466002)(48376002)(960300001)(42186005)(36756003)(47776003)(5001770100001)(104016004)(6806005)(586003)(2950100001)(4326007)(2906002)(1096002)(5008740100001)(33646002)(1220700001)(4001430100002)(921003)(21314002)(83996005)(2101003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4PR05MB1682;H:ld-1.internal.tilera.com;FPR:;SPF:SoftFail;MLV:nov;A:1;MX:1;PTR:wb-fw1.tilera.com;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;AM1FFO11FD007;1:3xqTKAiWTAyAVKk5aZaZPnGxCz4d8A95h1DH9zofvbrrjdUIz1tPAohk4zij5PLk4QU3HkhFm48Zxtvqm2PxW5w98IHYC2bW4ODq7dZupaSGZn5gH6ulHi8r2TAkHYHyUtqa6pFHRJjS4TAokq8H30FyggPru2iy6JiMt01gHE8nqwiFolOm0CAvgUvSsAVH6GXrdRBMx9065mqwAR111nNOtS8P/NLlXsSBOzfE5gRnidb7eA16nCJvzOUYtO7+XweAqa6pqqtTzzYQufQHjy0ahZzj2ZL0xYyVaS3nYpV+nnWg11RxWFA63R9ruahq7f9MjO0Mjqvahow7ebAdpyRl66yIfGHYNcaB+n7IVg3o25RBcj2gLe8i5yg21mvVfrdcQ7IaQr5Pr8qsnaQP/ByDVYOjHZ+Rhtz7lz4ktnXvMSS9n8Sodtn1tzTHyGWke01foi1VelUmE3CvJAm+YXObekbQt4h+qfgcm0RsOCXI4xmRrPE8Yn/0qPRJIJb9iWhDyq86m2Orh0eutDMJYS9obGHW3CgeA40yotmdIl+iNP/jBeEYopTYgXFdImk2 MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: df9f8caa-ffe6-4d59-e252-08d352762b8c X-Microsoft-Exchange-Diagnostics: 1;AM4PR05MB1682;2:v/1arF1GSUjMEY3MuFLJlAOFkiYNypNXbGmvuc7yR0sFXCUGcRsvIOqOk7Enq3TdMAxQY+sLsucKeR8l7AZ0PZifljpOBJEXbioyufYox6TvkeqQkyxEoPGdMfvInp3EHv6XkPcCJjvFQG4WPItdVrFu+DBuDVU2HdrPjs4rVG50kxicfxQqEpu584xODd1x;3:JEZjCS6Yaku2wZkL3P/WnKIYBEy7TOgkDTZ40b9RNDOxcJXLlzjFFxQBRnHpYsXERAMXskWYEt+2wz31SzsPgnklOZM4GhOzClmIWfSToh2BHyC5B6dB5xbdA1nnrtYhi5trM+pQ6HTjREOTKwtoim4dCau420rPac/iXHyuKDOhxzVh7uof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9t/ygKqQ3nWdvAsFLdN8ABuFP+HMkDdc06WRPbMJjyBUcZJgyNAJl8ZOLaKZNO01Lf6fg75dHjkFLwOmjJV90qbOQLs3ndDlBmLikd4XwZxMZbCh78fhCsOQrO8lQP2mEMF9v6pKaS3KvJ4WKCDKl8Hvj+kqr7EU7drlBwNYPpsf9lOreZFzU4k+SOzUJAjBmxC6HvDJNey6Ln/nzeO/UYFl5xG/UIhh4zl8IJEwD/ngdyKysnN8JcG+TcP2y2EKwa2GYOi71Vz/s/IJy+l+HeM1pRZyovorpcdRd5ebwu3e2A8/QRU3XxHOejWidzHoEyIogTJ15iJ0jz X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(13023025)(13017025)(5005006)(13018025)(13015025)(8121501046)(13024025)(3002001)(10201501046);SRVR:AM4PR05MB1682;BCL:0;PCL:0;RULEID:;SRVR:AM4PR05MB1682; X-Microsoft-Exchange-Diagnostics: 1;AM4PR05MB1682;4:taeDdoPYjLvIlv75CaLQePsTT055KKC70AQYCaNVmlXPz7QGHF4BtU+O/KLswL2UiEHN7YibZXUFaV/JFn8ybzhudWNI1E7Ena9efjsxmQif/TiWGn4t83nW4hwDEsJRsUgC3v5YpsOj0HdeZzt3BgnHwABHA7hUbVKDksSUNgHx2frUCgTyva7nYFksXP7UJsZsAz+S3kvMTPXAUXM8rruLJYanPKqMtnfhle6YTI5cFeEAD+3V7ZET5aWyfroD6rv5RsG1OfDRRYt8Yv2NPnRALmldkhRgywuR9yfP9Z9QfHzdBe2p80eN32p+nzv1yhbD3zGlnY/RHVqjzB8obr5B52ZZw1gd2TBJIPAXAibxYkLHDCh6Ua4F19yYccluE7YJozDZlJsLeBcU0dQyAkP5jnElfgi4vlv8bWJwgtBPc7Wqtid7CHPk1aC4siFb8Y9+0gv7qyCyqqA3xnuZ4g== X-Forefront-PRVS: 08897B549D X-Microsoft-Exchange-Di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ojdGCNnm7M6jI18Z8uth0vgZ?= =?us-ascii?Q?lDf50QgyD+eMWoPO8OD+IDJM805mhmkMnLZtozD4SsMiB9fYJWG9uiZglojw?= =?us-ascii?Q?PqH8Y1Gu07lEAazY4xU/Kyl929lNkSeRft5WgFrZFJwJqrbBBWdZh4Z9INzm?= =?us-ascii?Q?zXyc00Pip0UhF6lhx8DrxfhMjuDraxLX4UkMqF9deA3Z/p4ZTsnckkcxzSS2?= =?us-ascii?Q?AUdDwXSVqc/2xt6IvpiFCp8OeMidggYLB/Q2LjAdehl1O68xqR1CLYFdflUM?= =?us-ascii?Q?Fd6ADOXiiNQvmj7tsTkScj6qDkv/Rif2RBxk4wMqN/iI2tykMDNLncvMo9tG?= =?us-ascii?Q?Bg9lQWf7+TBcczH1NWamwlFYLz1mPM71lPthXFm+4yLdMGJwDD/tBsz6w=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1;AM4PR05MB1682;5:KGPqXlouQwgAauYuJN5cPmTsIMtDK6mJuaQzQOnQ6iK8m0yKDOC/R70cv/Q6gYRKSYZkBsFzjSo1ftLN02hBYzsQjGAmFmEdukS2bJE8ghBxJD9ZDEGjAfq0TVKksUATA8qEzF05HfKzMv5VhBbGUA==;24:RYJ+MAMSu0A+a/22oPYvYwRO0j4QK69N+XMV9H37Zmplax85AJV5vAvU5bL5kzkdBD4VNZYm4bLh7LERzLxp5DWPmYXXK1HHDwYNHkOXBoI= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2016 17:19:47.5275 (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: AM4PR05MB1682 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4527 Lines: 97 >From the version 1 cover letter: 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. I've tested that the change works as desired on tile, and build-tested x86, arm64, and arm. For x86 and arm64 I confirmed that the generic cpuidle stuff as well as the architecture-specific routines are in the new cpuidle section. For arm I just build-tested it and made sure the generic cpuidle routines were in the new cpuidle section, but I didn't attempt to tease apart the tangle of platform-specific idle routines that arm has and tag them with __cpuidle. That might be more usefully done by someone with arm platform experience in a follow-up patch. I have also pushed it up to kernel.org to pull if that's easier: git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile.git nmi-backtrace v3: Various improvements to the set of __cpuidle functions; Add back in a missing section accidentally removed in modpost.c (PeterZ) v2: Switch to using __cpuidle tagging, switch S-O-B to Mellanox https://lkml.kernel.org/r/1458147733-29338-1-git-send-email-cmetcalf@mellanox.com Chris Metcalf (4): nmi_backtrace: add more trigger_*_cpu_backtrace() methods nmi_backtrace: do a local dump_stack() instead of a self-NMI arch/tile: adopt the new nmi_backtrace framework nmi_backtrace: generate one-line reports for idle cpus arch/alpha/kernel/vmlinux.lds.S | 1 + arch/arc/kernel/vmlinux.lds.S | 1 + arch/arm/include/asm/irq.h | 4 +- arch/arm/kernel/smp.c | 13 +------ arch/arm/kernel/vmlinux.lds.S | 1 + arch/arm64/kernel/vmlinux.lds.S | 1 + arch/arm64/mm/proc.S | 2 + arch/avr32/kernel/vmlinux.lds.S | 1 + arch/blackfin/kernel/vmlinux.lds.S | 1 + arch/c6x/kernel/vmlinux.lds.S | 1 + arch/cris/kernel/vmlinux.lds.S | 1 + arch/frv/kernel/vmlinux.lds.S | 1 + arch/h8300/kernel/vmlinux.lds.S | 1 + arch/hexagon/kernel/vmlinux.lds.S | 1 + arch/ia64/kernel/vmlinux.lds.S | 1 + arch/m32r/kernel/vmlinux.lds.S | 1 + arch/m68k/kernel/vmlinux-nommu.lds | 1 + arch/m68k/kernel/vmlinux-std.lds | 1 + arch/m68k/kernel/vmlinux-sun3.lds | 1 + arch/metag/kernel/vmlinux.lds.S | 1 + arch/microblaze/kernel/vmlinux.lds.S | 1 + arch/mips/kernel/vmlinux.lds.S | 1 + arch/mn10300/kernel/vmlinux.lds.S | 1 + arch/nios2/kernel/vmlinux.lds.S | 1 + arch/openrisc/kernel/vmlinux.lds.S | 1 + arch/parisc/kernel/vmlinux.lds.S | 1 + arch/powerpc/kernel/vmlinux.lds.S | 1 + arch/s390/kernel/vmlinux.lds.S | 1 + arch/score/kernel/vmlinux.lds.S | 1 + arch/sh/kernel/vmlinux.lds.S | 1 + arch/sparc/kernel/vmlinux.lds.S | 1 + arch/tile/include/asm/irq.h | 4 +- arch/tile/kernel/entry.S | 2 +- arch/tile/kernel/pmc.c | 3 -- arch/tile/kernel/process.c | 72 ++++++++---------------------------- arch/tile/kernel/traps.c | 7 +++- arch/tile/kernel/vmlinux.lds.S | 1 + arch/um/kernel/dyn.lds.S | 1 + arch/um/kernel/uml.lds.S | 1 + arch/unicore32/kernel/vmlinux.lds.S | 1 + arch/x86/include/asm/irq.h | 4 +- arch/x86/kernel/acpi/cstate.c | 2 +- arch/x86/kernel/apic/hw_nmi.c | 6 +-- arch/x86/kernel/process.c | 4 +- arch/x86/kernel/vmlinux.lds.S | 1 + arch/xtensa/kernel/vmlinux.lds.S | 3 ++ drivers/idle/intel_idle.c | 4 +- include/asm-generic/vmlinux.lds.h | 6 +++ include/linux/cpu.h | 5 +++ include/linux/nmi.h | 63 ++++++++++++++++++++++++------- kernel/sched/idle.c | 13 ++++++- lib/nmi_backtrace.c | 40 +++++++++++++------- scripts/mod/modpost.c | 2 +- scripts/recordmcount.c | 1 + scripts/recordmcount.pl | 1 + 55 files changed, 177 insertions(+), 117 deletions(-) -- 2.7.2