Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756706AbcCUQPd (ORCPT ); Mon, 21 Mar 2016 12:15:33 -0400 Received: from mail-db3on0059.outbound.protection.outlook.com ([157.55.234.59]:23596 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756270AbcCUQPa (ORCPT ); Mon, 21 Mar 2016 12:15:30 -0400 Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=mellanox.com; Subject: Re: [PATCH v2 4/4] nmi_backtrace: generate one-line reports for idle cpus To: Peter Zijlstra References: <1458147733-29338-1-git-send-email-cmetcalf@mellanox.com> <1458147733-29338-5-git-send-email-cmetcalf@mellanox.com> <20160321154201.GA6344@twins.programming.kicks-ass.net> CC: Russell King , Thomas Gleixner , Aaron Tomlin , Ingo Molnar , Andrew Morton , Daniel Thompson , , , , From: Chris Metcalf Message-ID: <56F01E10.6030909@mellanox.com> Date: Mon, 21 Mar 2016 12:15:12 -0400 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: <20160321154201.GA6344@twins.programming.kicks-ass.net> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [12.216.194.146] X-ClientProxiedBy: BLUPR0201CA0026.namprd02.prod.outlook.com (25.163.116.36) To VI1PR05MB1695.eurprd05.prod.outlook.com (25.165.235.157) X-MS-Office365-Filtering-Correlation-Id: d7dcbab1-a9e6-4490-daa8-08d351a402ba X-Microsoft-Exchange-Diagnostics: 1;VI1PR05MB1695;2:Akw9ovCJb5ESma6VvxVR5qVFjFAcXToJ+Ov1PoLhdDQ0ez3H4o0OYHDZ63M0uj+u3ZkoT+yQMsb6Y6XYvGBN/r/peNM1ZrESf727mlwLziM9AeDDUREfTXWOljo9uKCyKivTT2XOTH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rkmrlGO34wmLBHs8GUdBkIoCAqNQggbmLueWSCSuYZCPctcVgQ6YnyS50trPEvZbOTMBL5rqn9Vm6zWzG4CgNgW5ROJjxCbEf8xhZ//WzbWHS8L1jM8TtMu0EW7DzL+ocwix4CLL6SQEljrdpEnFPXoHvl9Ky4JBV9ZTm5e0f0NKzwiSX1EsvA9ir2xFwRZUT4JUV9pHS7XFB8wh4lGgRXR9125gu3P/j5bTE3l/GZ6aABjwreNlXkjfE4pYY3TjTe0sqUBEfPRyvOqSe9BUJKRd47IGe7MIzToyH4yahT6ZJy/UgFERmgwm2Vbg4;4:DcBhjOMmYsNcJ1DfiXIDp/a9wtnQP45Eu0RHKZlgoEG+d6i8prS30M3feeAJCpTpEKRhrMcTQa9dLS98Pjty8hf20T67boikPIObzd9i3MR0GJWLa5tK4r8l/up8MWpc+rbuWgxP5bgTXj4kI3b6wIVqEepcfQnVwkQNyUI4QQrTUSG2ElxZ1LZBwuZScC4peZg8OlcYpu3ZfknHifWj+pTyXQ4Q1Wp7UUORALBRC934MuTKrXNXvvnYjfhGex4dK5l5n4POcBhDb/F43hNmhObXffJZkR6F+hmky6+6CARN73ZmZ6x0XGk0HMpWJI36aS0FzjCwkyrRuqKbfjR4ZV8XpPybQYYPnb1vsbN2JLS0YgQHZmToMSkiCQ04kSS4 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:VI1PR05MB1695;BCL:0;PCL:0;RULEID:;SRVR:VI1PR05MB1695; X-Forefront-PRVS: 0888B1D284 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(24454002)(377454003)(50466002)(36756003)(23746002)(110136002)(92566002)(5004730100002)(4001350100001)(189998001)(6116002)(3846002)(5008740100001)(2906002)(230700001)(86362001)(81166005)(83506001)(1096002)(4326007)(586003)(19580395003)(2950100001)(77096005)(15975445007)(33656002)(42186005)(59896002)(64126003)(47776003)(66066001)(65956001)(65806001)(54356999)(87266999)(76176999)(50986999)(65816999)(80316001)(18886065003);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR05MB1695;H:[10.15.7.41];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;VI1PR05MB1695;23:cFPP+sZHcqgZYplcPIXn+BEUJ/EPSGqkUH4KH?= =?Windows-1252?Q?umlRC5MV1MqRzDPOu5WLf/eS1QzH2Y4KCO+OX3+zyee3bxJmNjQjYiDd?= =?Windows-1252?Q?CbhrsWZMrpR/JxofpFFiZL1mrn9qLzyazGgmNwDFRMrAHu1XgAA369YR?= =?Windows-1252?Q?U43uVOrElk5CIxm8jtJ/06WE2x5ZqV1I2l/ZAjeE9iOJhsmAKY27PA6q?= =?Windows-1252?Q?VmmyVuEqGjGPvpv2vx8eW9HlgZgr8jvBLMEaVZxvQ1FtZ53NFX9X2Pix?= =?Windows-1252?Q?ks0blHXz9gCA02u5Hdn1h2z81BLQ8cyxEHWkP5IYQ7n+qPkkPv0K/cLt?= =?Windows-1252?Q?hL7CjK69w3VU6UvQ/lO4K10SDaICIlN00wkZMrr6uFcRxXbs9YKIMLyf?= =?Windows-1252?Q?la4prpwS+25I52wdYPBB02M+CHUSTcotDpN50ZT47t5c/7+lFxPHt+3j?= =?Windows-1252?Q?7IIFELEvcHgX+G9dPfgaT+ceixPd7l+QDB3g9inCHpt1I7wmTMTNPCwB?= =?Windows-1252?Q?GXS13hFHEerpEyJZ1Vxrpkx0XICuUSGyDsmeyHo4Tllrrn6lOfHd8bMy?= =?Windows-1252?Q?49CdYryk4+D3cQgVkAzWxw1QZU34ve6AZjgMWKiTl22esJ+Ma/cnPBkj?= =?Windows-1252?Q?JNIoI3ZGpWqc+0ssHLbisM9/TwKOwXNugBgQA9bxxAZpCFByAN5PR81t?= =?Windows-1252?Q?hfiJD11/RHUvfWWAfcH0qTdyJScfZ6YN8DqMfMlaAm/hZOC/oHQqxU2i?= =?Windows-1252?Q?XzJoAVOTZ9atKxTxhapJzqyHRt90DxsMgMrEwfLquQdshBFFc0/vn6kc?= =?Windows-1252?Q?U/J2GIf2hwXNUOqhOHN1/QVh/9qRg+WJ84Ds1gP++LL4dwiIrbW+4Ue8?= =?Windows-1252?Q?7OpshYa5gwG2TDrNuyC/TyRuyZB1WnK2HjtRXJQ4eqnrmYTcUTlsjt/m?= =?Windows-1252?Q?WLe6cgNVaD4kCkFQY7NSwTcTdvFtVk79J7KDYcSkp64XrsZrs9pICkut?= =?Windows-1252?Q?r/QQr2pIZukC7zFXdFyQNsUckNpsfRL6pWbMgiSH3pMiSs3L+effBL30?= =?Windows-1252?Q?GPXi3yBcTmGTOhf3KNLyT3qh1JMoCPzJfZvzn6nSRoN3pgEMh6BQKKaq?= =?Windows-1252?Q?ciD+s2EOyv37196HrEbBO9TNs9tVsPDT564oEa1eFoGP1NoXFEL1FPom?= =?Windows-1252?Q?cxrwmz0sotXra4kzzmln5oTpbdxzW/HXCfRDbd5YTgWOHMAH6ku?= X-Microsoft-Exchange-Diagnostics: 1;VI1PR05MB1695;5:8WzeV8TaoGkrm4xDZCzbkwd6MbrErBOSmDk/oDUaG/MXcW8SrV0X0VdQ++qcq5/lAIFdpCQP3AjDEXNHg1ZwNuSswjrBI5RuOBbIMNCuXhj8BeHkAWvu9RfYMRp+aIcAWSNnuN3fo9rpVrPxltcHpw==;24:vQSp3elHKMr4ZPJ5CXqDrsxUCK1Lj+KX/UKk6BjLNZ8b5vsxhXRNsGKc//Uh5Ex64M97QMQXpXxIMdG3Cymnt9tkqKJUY4sTLT3Jk9FoHlE= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2016 16:15:23.6657 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB1695 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2241 Lines: 54 On 03/21/2016 11:42 AM, Peter Zijlstra wrote: > On Wed, Mar 16, 2016 at 01:02:13PM -0400, Chris Metcalf wrote: >> diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c >> index 9f7c21c22477..d569ae7fde37 100644 >> --- a/arch/x86/kernel/process.c >> +++ b/arch/x86/kernel/process.c >> @@ -298,7 +298,7 @@ void arch_cpu_idle(void) >> /* >> * We use this if we don't have any better idle routine.. >> */ >> -void default_idle(void) >> +void __cpuidle default_idle(void) >> { >> trace_cpu_idle_rcuidle(1, smp_processor_id()); >> safe_halt(); >> @@ -413,7 +413,7 @@ static int prefer_mwait_c1_over_halt(const struct cpuinfo_x86 *c) >> * with interrupts enabled and no flags, which is backwards compatible with the >> * original MWAIT implementation. >> */ >> -static void mwait_idle(void) >> +static __cpuidle void mwait_idle(void) >> { >> if (!current_set_polling_and_test()) { >> trace_cpu_idle_rcuidle(1, smp_processor_id()); > The most common idle function for x86 is: mwait_idle_with_hints(), > trouble is, its an inline, so I'm not sure adding __cpuidle to it does > anything. No, you're right, it wouldn't help. I didn't look at the drivers/cpuidle subsystem at all in my patch, since I'm not that familiar with it, but it seems like tagging acpi_processor_ffh_cstate_enter(), as the only user of mwait_idle_with_hints(), will do the job. I do see that native_play_dead() also uses mwait/monitor, but since that's hotplug I don't think it's relevant to this patch series. > I've yet to find the magic objdump incantation to check. Or rather > objdump -h doesn't appear to list .cpuidle.text at all :/ > > I'm probably doing something silly... The easiest way to check for a given function is just to look at the "nm -n" output and see that all the functions you expect to reflect idle behavior are in the cpuidle begin/end range. Or, to look at "objdump -dr" and search for monitor/mwait. objdump -h certainly works to show .cpuidle.text if you look at individual objects (e.g. arch/x86/kernel/process.o) but by the time you're looking at the linked vmlinux image they have all been linked into the giant .text section. -- Chris Metcalf, Mellanox Technologies http://www.mellanox.com