Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754972AbcC3RQa (ORCPT ); Wed, 30 Mar 2016 13:16:30 -0400 Received: from mail-db5eur01on0073.outbound.protection.outlook.com ([104.47.2.73]:17664 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754663AbcC3RQ1 (ORCPT ); Wed, 30 Mar 2016 13:16:27 -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" , Petr Mladek , Russell King , Thomas Gleixner , Aaron Tomlin , Ingo Molnar , Andrew Morton , Daniel Thompson , , , , CC: Chris Metcalf Subject: [PATCH v4 0/4] improvements to the nmi_backtrace code Date: Wed, 30 Mar 2016 13:16:06 -0400 Message-ID: <1459358170-27745-1-git-send-email-cmetcalf@mellanox.com> X-Mailer: git-send-email 2.7.2 In-Reply-To: <8028886.DUEJzF47F1@vostro.rjw.lan> 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)(339900001)(199003)(189002)(87936001)(105606002)(85426001)(47776003)(106466001)(229853001)(50986999)(2201001)(2950100001)(50226001)(86362001)(48376002)(15975445007)(960300001)(92566002)(50466002)(36756003)(33646002)(5003940100001)(42186005)(5001770100001)(107886002)(19580405001)(189998001)(19580395003)(4001430100002)(6806005)(5001970100001)(104016004)(586003)(5008740100001)(1096002)(1220700001)(4326007)(2906002)(921003)(21314002)(2101003)(83996005)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR05MB1689;H:ld-1.internal.tilera.com;FPR:;SPF:Fail;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;DB3FFO11FD005;1:v9sTVWzVpcpAqwpgdxyqeNt4P+WTomBIQ+10I8bPf5ibnSckbAceZ+F+am6oJqaOslen/Ur1SZns6NKLiiEasLGb46QqslsI+2HNrYJ78uv9QbIcmI0wtcpni0qD3N1qCmGbHvj5P2VVAOiJ30ybW158RfHoEtGqiRGaVziPbfX0fHrKdcQxk+oN1mrFTkz2WAtIDtOEmww67xFRVfuwcJHUHpNsFVrTs9ok/UfB38/pLq9VnW1NBOKu3WPTESBvVV+CRqoAMM9Jz1Qiw72p/U1ZW7eyYBULQEMsZBmxnfnd8Swzl93rI5hCPjUpV6wUszEZVk5aR2qvWMrddZBzjv6VNm4Q84CZerkbc0T3m0QPR6KCNg3ej/KUqK6Ysz6gh8GgeY95b2Fq1s7GQEUjwlWsII1amUU9/f9uMVXFalXIVsjv/jqw+/rXu8Qo4zqvhRWQrPim0ECzVB8bVoyeg391JBSS0AZ1aww8T5ZLtTsKYNUtpEE3uN9zjUqkf6qBWvp0vPh7NaYlTnrQ+TYPW1dvEc+ANZd0mCAUTaBIWmeR0qqdCRscLieHOSRYS3ME MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: b3b61b81-f97c-4dda-e1e9-08d358bf00db X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB1689;2:GIhkPs0Z+9UbZeGIZj6mSusqZYOYpUJo8BfqEhK4JsoaeacbME5JB+I6iGSdqFPxZikn6qOeZ9UT1oepVrwGiiVAaGmzIRNzNkUGSSmb+wzbC/24SWwSSTo9g2tYEreDxwOXmwZv+5dzBr98cxMyO/VnD2guKIzTY+WxfkJudJBrBFSA8AbedLIvdgFfW9R0;3:RGIO1UI5gKk6MqtKGBhP2q86o6Rc+dQi/m5UK9YU7x9DCl+uXce3i9tPKwrlfVJUFGOvcVcL/YJ+I97KUQ+U3ptSiOj6R6qsOTmJh4hcQAcF+V7IaAcQ3q27vUVqZTMW4vf48xzE86l71e0gdLS9LRlzVLckxAiLDjptDqd480A3MkEOHe5DQ9aRHDWBBUj0iU573VYI5pbwvgb1Rlcp0RE1r7vK9AO8Un2hOlcp5Dc=;25:zHI30nut6xNy4cAXy8f3GKrsgVSkOXT6YwP/WhbUlrDlAO0rhCIO63n73HlpITnGDrRXJxzjubrLAbczpu/nAVJ1hsF7nzhUudbd8WP2yohAdVohHGfv/xzSQC6EtPzS2vo18tKWrgn1QEmyHooVzjTf4kI/RQOLiUyptoi8Imllp/YP9kwqlBnbLj2pThLxOPNgJ+pJqEzJ+1dRwx60nPvcmGFiuvfLKDuFeYCvQBIDcSxGk1+uOPXfBdZ7Aev0vr8CUciotbUKSyItswFM4wQaLiicZALAkM2y7PqN/nYZqIrTvWuk8YfEyKlQZNfYeq39v6EAs9Jg807otbEvlX7ALpLQfn2xNooBD57HTZ0= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR05MB1689; X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB1689;20:OLFZkzpzzsz+TSE7dZH3XxX0IEE2KLwfDH3LB/8cTD7rBOn98IbSrk7DbjCRe/lpkkTlillfhc1Scc6649MmelQQdC8lkyS1qIoOjz+jqb7s6VfwAwAusCyPqXsoLJ0k9K8eXKIIf/tlcC72Pp6qv32hH0dAkxnwY88nV7Cif805SM4JqnYytxUEepFVrLF4y5eBK8FT5kEaUw5ZwzEL3fr106lW+r41L7lGi79I6J0WH9dyJtELMFUxokbkuT++0RBhH+DZJEXtQNuQDeMRo6e1j+0aZJiEArFZrxCeb4HV0yYSV6+T0LCCIgzsM7XpjAlOd3tMuu5gUqwNgiymv7etJQoP+hAyO+hUANh9YG4bggca3n3Y0qxefVdnvnUQp3Dcy2HM44sRNiLrwuX+/4dGhdbxpl3/hcQchsAHui8pHvkA9VdABD0h2WsYPtJDmaxUdX2gYFB3u6uEB9tLCXwchOE1lY+7v3HHq174JSQy8lGAvq6VxuduvQ6HmPOh X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(13018025)(13024025)(5005006)(13017025)(8121501046)(13015025)(13023025)(10201501046)(3002001);SRVR:HE1PR05MB1689;BCL:0;PCL:0;RULEID:;SRVR:HE1PR05MB1689; X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB1689;4:vyQzM9o+qldzaBXGCVBJmK0BTiX75GTIBKGTcQToJ34c/+GocJp2W8ijfpG4IzoLHUOsvr94rkFH8urKTEdybwLDPYeDxRw4I/ZrMW6aZdgx7JElgPiVmsb1jmizrH6pq/W23B7s7efR0b9WCY2wBM6P9fHH2SEcsz/I0aFsS8t1y3m5euBcksX05oOv8VcX+dgop3xl4XjYdjx/6vKYxM1U+Y+PEZ+67BXiL3WyiolxkkJBYfgpBuyLC/YOqP2Z4KDjYo8Xi/Wv73zxsUaZAkPYyZCSCQv0R9xvcNVg/RPhE1X4/YqWzcnZORNy2oUj6U0teLruOkvDLgYRLPXYOPE4B3mVH9LiSbjNOpkf18X9UJxUlEDlUd/S7d1uVpik4VE94/Qt9PqO6w14u1vO9gyoW8KpxIXP2a70K1k9OPbcwJYvf+vrKn1A3S34+tLHMa0TPIl5xxyGaNoU7G/8tQ== X-Forefront-PRVS: 08978A8F5C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;HE1PR05MB1689;23:IDX52aXIs5aUQX5wIZqG6nvh2A9/PP7Joopa4TTKw?= =?us-ascii?Q?kOMUh3MCni4pQZUI5og7YLLipJJFr+pAIXGsxgQBkMFbklqrhw0Ae9Oh8KAi?= =?us-ascii?Q?jo2a+ADXiNGktzFUzxgHiOoVQXTdb97U8PY9CqMaws3zPgz0zsMr9GumdO6J?= =?us-ascii?Q?hgqDd0iq6NJG9vV/5ajFF0o/jut4/E4adnsib4ZBEt74VF4pkbBT7pfdMiaq?= =?us-ascii?Q?VKBYXBxyARJfHr6mzPuCSv3jqbtxSUaMtlW2wF6PG8rglMVXXTxFefuG7QNy?=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qgf20M8twutOCZx4Ocoloxw/XQfbbu?= =?us-ascii?Q?ujAxpCdanZjyuI5qviqngw+XNcn7nbP9MKq?= X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB1689;5:hjs1exLM0RDvEcPV2cgka1yWDZiPMij1lSbY0HLLO9ddoXv924wt/V56JNgLStHGmD6TuyjpASXDaIYJlx40DXvk0YAgHu0tnef5XG1AdNV4RTm4LFimc4cFnp5bTxood7pTksSoaeaGQvV8ApsxpQ==;24:aJ9vR5TBrhKekFtdh4E4Y6JD4EgLbedtgplcokxJ7wndvdbdmgvUOL+WPIOebGmJc1ZCvYWK6J6Dn9hfZCJYlGjI7TLnJUA0NU93MF/S7nA= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2016 17:16:16.1567 (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: HE1PR05MB1689 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5000 Lines: 109 >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 The change conflicts with Petr Mladek's NMI printk cleanup patches: https://lkml.kernel.org/r/1459353210-20260-1-git-send-email-pmladek@suse.com He has kindly offered to resolve the conflicts. v4: Added some more __cpuidle functions (PeterZ, Rafael Wysocki) Rebased to kernel v4.6-rc1 v3: Various improvements to the set of __cpuidle functions; Add back in a missing section accidentally removed in modpost.c (PeterZ) https://lkml.kernel.org/r/1458667179-19630-1-git-send-email-cmetcalf@mellanox.com 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/acpi/processor_idle.c | 5 ++- drivers/cpuidle/driver.c | 5 ++- 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 + 57 files changed, 183 insertions(+), 121 deletions(-) -- 2.7.2