From patchwork Tue Mar 22 17:30:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 8644171 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DBDB99F294 for ; Tue, 22 Mar 2016 17:31:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 160CC20386 for ; Tue, 22 Mar 2016 17:31:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E6A37202B8 for ; Tue, 22 Mar 2016 17:31:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aiQ8D-0005fy-BS; Tue, 22 Mar 2016 17:30:13 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aiQ8A-0005ez-Hx for linux-arm-kernel@bombadil.infradead.org; Tue, 22 Mar 2016 17:30:10 +0000 Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=twins) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aiQ86-0006Eb-0O; Tue, 22 Mar 2016 17:30:06 +0000 Received: by twins (Postfix, from userid 1000) id 4B78B1257A0D9; Tue, 22 Mar 2016 18:30:05 +0100 (CET) Date: Tue, 22 Mar 2016 18:30:05 +0100 From: Peter Zijlstra To: Chris Metcalf Subject: Re: [PATCH v3 4/4] nmi_backtrace: generate one-line reports for idle cpus Message-ID: <20160322173005.GT6344@twins.programming.kicks-ass.net> References: <1458667179-19630-1-git-send-email-cmetcalf@mellanox.com> <1458667179-19630-5-git-send-email-cmetcalf@mellanox.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1458667179-19630-5-git-send-email-cmetcalf@mellanox.com> User-Agent: Mutt/1.5.21 (2012-12-30) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Morton , linux-arch@vger.kernel.org, Daniel Thompson , Russell King , x86@kernel.org, "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Ingo Molnar , Aaron Tomlin , Thomas Gleixner , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Mar 22, 2016 at 01:19:39PM -0400, Chris Metcalf wrote: > When doing an nmi backtrace of many cores, most of which are idle, > the output is a little overwhelming and very uninformative. Suppress > messages for cpus that are idling when they are interrupted and just > emit one line, "NMI backtrace for N skipped: idling at pc 0xNNN". > > We do this by grouping all the cpuidle code together into a new > .cpuidle.text section, and then checking the address of the > interrupted PC to see if it lies within that section. > > This commit suitably tags x86, arm64, and tile idle routines, > and only adds in the minimal framework for other architectures. > > Acked-by: Peter Zijlstra (Intel) > Tested-by: Peter Zijlstra (Intel) > Signed-off-by: Chris Metcalf For some reason I found a few CPUs using poll_idle(). Rafael, when and why would that ever get selected as a useful idle state? When the predicted idle time is so short even C1 isn't worth it? --- a/drivers/cpuidle/driver.c +++ b/drivers/cpuidle/driver.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "cpuidle.h" @@ -178,7 +179,7 @@ static void __cpuidle_driver_init(struct } #ifdef CONFIG_ARCH_HAS_CPU_RELAX -static int poll_idle(struct cpuidle_device *dev, +__cpuidle static int poll_idle(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index) { local_irq_enable();