Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753280AbcCGRFa (ORCPT ); Mon, 7 Mar 2016 12:05:30 -0500 Received: from mail-am1on0060.outbound.protection.outlook.com ([157.56.112.60]:24735 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752726AbcCGRFV (ORCPT ); Mon, 7 Mar 2016 12:05:21 -0500 Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=mellanox.com; Subject: Re: [PATCH 2/4] nmi_backtrace: generate one-line reports for idle cpus To: Daniel Thompson References: <1456782024-7122-1-git-send-email-cmetcalf@ezchip.com> <1456782024-7122-3-git-send-email-cmetcalf@ezchip.com> <56D5A5E6.9050206@linaro.org> <56D5BCE6.3010300@mellanox.com> <56DD3B3D.1010404@linaro.org> CC: Russell King , Thomas Gleixner , Ingo Molnar , Andrew Morton , , Aaron Tomlin , Peter Zijlstra , "Rafael J. Wysocki" , Daniel Lezcano From: Chris Metcalf Message-ID: <56DDB4BC.3040301@mellanox.com> Date: Mon, 7 Mar 2016 12:05:00 -0500 User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56DD3B3D.1010404@linaro.org> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [12.216.194.146] X-ClientProxiedBy: SN1PR11CA0011.namprd11.prod.outlook.com (25.164.10.21) To AM4PR05MB1682.eurprd05.prod.outlook.com (25.165.245.153) X-Microsoft-Exchange-Diagnostics: 1;AM4PR05MB1682;2:0q8QV1QqfoRVOJBrqQeblOdlHM61bYPj8rujKiqQGdF2AEqFVPai6cUZt+vOF/F+TtpSMhOtVzJs23UU4aGEs+lRTVMzzT4oSjDEd0B+DnnzTkG7fSW6xuYehs4SfqB/alz/QwCEf9zsASwCyuJrpA==;3:6IGCNldscrOTIwsap4MnGWdbBtWkbHAevetM1QQVpntoaOWgdWlCaZFTIld92Y0n3IBN1crbbq3ohZnbcnPzkWviheQYNZWOcgnKrMiIy9HVjLxZoNplOdBmY/wbvIbp;25:k+2YHSNZI0F1Yoo/ByYb6XVYzsX7dUzqLGho/s1+FoIVXI+Y1Z9buQzC9vsCfY9QwCQrrVCBA+sRnAlpMMJ6zI+6O4hMcgYZnSSLZtd5GNM6eUJ0LfzzzNbKbKBsMvbLTKAYQfHSuSikxlCQvWDiBRHp613RRU4DUWKIQZwK8DDqICI6s7Ldj2qcnLlPV2IbBB6hh183e3lx8/4zAov/c5M69dCR7p4dPjifaJnm2HV4VN7fOuRjI6wJMqkYZjzH19yVXSNArxVzVMzZyh16hotTVgYZCwBUM0Yi7WsXt1RaFt/Zg1xsK5m60Xz3RxHtU1IZRHuz95hque2Cv8LDSw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM4PR05MB1682; X-MS-Office365-Filtering-Correlation-Id: 279fc27d-1156-428b-bbdd-08d346aaa7de X-MLNXRule-EZCH-Linux: Rule triggered X-Microsoft-Exchange-Diagnostics: 1;AM4PR05MB1682;20:+O2Ty6/dEbyLtSYBQtsvlbVwAYgi7aRxg4t+/vv7/joYs0XE4YuU0SSIoalXgkv0HGMYSU8euHqmhCz5gxRn0RydJ4h0DnBE853y/2yiEpJonKvQmUrwXDAzkoyVC9KrXAtuWevaLPI1dk59FRv49bxCFaRD5GMaawnMF22XbxSKGZyNQJG9naRfEdbuciQ/l2+fUZwMfxhRSl4bXUJypqO79qhuzvEvmpvNSz5DUyziqyJQkhGos1GvpnY03BN8YVLQNRk/9b6fxp9aPang9RMDf5qkFYGpfuLtAJyGkbtAXh2leyGf9GtSQ023PsOZW3dIEWkhae7P7hCqy5TbXjHoqLuuxsIOixk9tWvVnVVXfED10fcFGy7q51WnTDbns0pQ8NC7x4ZNe3X5s/rZQ0c0S22GYASCRjDLL7gXwVrYBYRtwIAK2Gym+WD7HUpxDQVW4eHbuVM8xfcH3q/9ZsmTO82DNLNBiblmQIFpC/jMHEL9V5ewZEQ/FRjYGz0U;4:apBCKPYCh7TCz6W9/77wnpkt+qI8R9vqmrDDz9btDX+urgOoh8pTk1p72sN6SWOcOqDO53FAzOEeGOf8T/Oznlw3+LUl/p2ssYprqebr0PgnlnGlcA+vlthX7gih05G/ECLNKIIgFi5XdbIHD6RJR20RSBBN4B7nalI3X/NXwzEwWhDM3kBxUvQKWW2YDKEOaUpaq5yO+VBqAlChRR99Sp/NeenW79AbUF0tRdaXY5SH1b1HszAsjYrylGHikMRbRt3CGfC5/xlQxEWAblWCzKQKVYuJVHNTCkEaQEp5kfesp7g743tpcTNgwsFq5m5dNzYsLxuMX49H1O0Apz3ssjdDMV+l4DMMbQaC4+MnQv/pRuJcTmjLCF6RK/1KHWiS X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:AM4PR05MB1682;BCL:0;PCL:0;RULEID:;SRVR:AM4PR05MB1682; X-Forefront-PRVS: 087474FBFA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(479174004)(24454002)(377454003)(6116002)(586003)(3846002)(81166005)(93886004)(65956001)(66066001)(65806001)(2950100001)(36756003)(230700001)(110136002)(2906002)(15975445007)(4326007)(77096005)(86362001)(23746002)(5008740100001)(5004730100002)(50466002)(50986999)(33656002)(80316001)(42186005)(92566002)(65816999)(122386002)(4001350100001)(76176999)(87266999)(54356999)(87976001)(83506001)(19580395003)(59896002)(189998001)(40100003)(47776003)(1096002)(18886065003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4PR05MB1682;H:[10.15.7.41];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;AM4PR05MB1682;23:9nmiQ+yw/5R2MBwrJmLOoYxF82UGABicwdT6+?= =?Windows-1252?Q?tKUCtkbnJ6N03/HZfa4knO4dytYzn4WuSQx30NKO+Z8VNWVwlVfXqLR5?= =?Windows-1252?Q?eaHxHEnrg6w0F+EIL1LD3qYjZmHEmp4OIbWjBozDyBBSGZg8bPh1iGvy?= =?Windows-1252?Q?jKnQsaQ0Ka0gUK3ZxdnHPeXeY0wsdg8cS824NcKVQJeikiHvXw99a2ul?= =?Windows-1252?Q?E5vwiYFnsLia6f2NL9QE3wt+wDU7xvTdCF/6rr030kmLfmtTeHGpGS/+?= =?Windows-1252?Q?maTostnztbZtGNs+i3IW5KaLG5wRECP424ht6O4BgeopntR1QUeIiN0a?= =?Windows-1252?Q?rCIDzQQZ2Ekqe+0IPP8/ba6ozQZ6kMvA3EnNRKUlReZzH9MU3PbIJLzm?= =?Windows-1252?Q?uN6Wte3/Prd33lqQO5cIlK3jSwyNFo4s048hTW4IXctc1FT45jphPLUv?= =?Windows-1252?Q?6kzS9/anIOsMKPydZaYAp7omUnVp5dek68jg2qOR6G005812jMb6zPHh?= =?Windows-1252?Q?zHiPlLCF6Cb1tCZ4iOMgMpSQK643YZgn8CCJkZUPKOC1P6kYqOYiliTg?= =?Windows-1252?Q?z9+0tyIxZu/7JgfCU4vQExSwVPXEq7huFkAsoENxjsRwelLixF6kXkRF?= =?Windows-1252?Q?cSatGlY/jUKEI2vTH360ZXdJ3IP/QKsBKWu2EwU+69Nf/jW34hagV4u1?= =?Windows-1252?Q?MxrmDXY858XrbXp7DrixSlgwzoPm6ax8srcVIAOSliBdR0DhBRRIphEi?= =?Windows-1252?Q?12WOu8+nxpYAPzgUoMOKLQzcYEERStz6rYleNKZ9SzH/wkcteBkdM+dl?= =?Windows-1252?Q?4C3JujQllxg6yzgrr5iJ3UMzKIrDROYbWhih8Ulvp6WDN5U43bfPQ2ZU?= =?Windows-1252?Q?jNzLhiS/LIvTvBq3tDs3oB2EBQ86QP92k3Wa+Qcslg9wwk3hxCUVfYuI?= =?Windows-1252?Q?SI+sn3cGtFQiebS9AUkDDr1oGfVzCtp2tQR49akr9IHKBxwhGvlMLRFP?= =?Windows-1252?Q?L1jMmIRQcmyV+rCpP8pWqYPUOR46hak58MPSKgMnCdAVaidr4sNOmQjM?= =?Windows-1252?Q?A+i6S3LeftO9Kd30k77TcuYMh1z/XABpRAZbJj+/a4YptyUl965xpeiF?= =?Windows-1252?Q?oxagVS0wBIAJCLOiweMTKOD7PI1H+FW6k7SUCksVpWzoe+jb2SUHX8+w?= =?Windows-1252?Q?vKanA2udM5Fv/4IWTO73VC7UfbMr5qZvWAMHk9lYmd+KWTnyrmRXMEHH?= =?Windows-1252?Q?TdrLthYz14rwyDjZ+NU2gQEIsy/5YBSUhJjERgnxspIsCJtnJNVdpWBK?= =?Windows-1252?Q?uvdiuvJkS/zt7n3DjW9ZKl1PQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;AM4PR05MB1682;5:cUmb+YdgXWxZKw6s3MBA3jXWWANEZOBRnnESqFpHrz8eMNPvOc9U2HC0nzEp0WifdkN/U0n9vTVugKk+m3kxKxU5z5+Kpv9BBqx4RvTB1dIESF/wEAnbjUn+n4lDjg42McQnsNyWq3Om5IbBIzfJ1Q==;24:1IgAIC922I5QphpST0IHywcDQfkPI/tLkXP+q5fG5rw03qxOv8z94TCKdk27YVYdf9NgzXcJkLfxTcAYKEDFvY9ug2QCNgHjMYRf7kKcm48= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2016 17:05:13.9147 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted 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: 722 Lines: 21 On 03/07/2016 03:26 AM, Daniel Thompson wrote: >> Chris Metcalf wrote: >> +static DEFINE_PER_CPU(bool, cpu_idling); >> + >> +/* Was the cpu was in the low-level idle code when interrupted? */ >> +bool in_cpu_idle(void) >> +{ >> + return this_cpu_read(cpu_idling); > > I think we continue to need the code to identify a core that is > running an interrupt handler. Interrupts are not masked at the point > we set cpu_idling to false meaning we can easily be preempted before > we clear the flag. Yes, good catch. However, mooted by PeterZ wanting to keep any extra state-switching code out of the idle path. See my reply to him for more on that. -- Chris Metcalf, Mellanox Technologies http://www.mellanox.com