Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7588831rwr; Wed, 10 May 2023 09:59:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6lOPh4H9TVjAAm8/fxhFFmTD+c14F74/VFAXdvnZQMNSfccNZQuxCn7+/1QC9tA6X77AlZ X-Received: by 2002:a05:6a21:158f:b0:f6:3a10:eac1 with SMTP id nr15-20020a056a21158f00b000f63a10eac1mr16951209pzb.62.1683737950110; Wed, 10 May 2023 09:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683737950; cv=none; d=google.com; s=arc-20160816; b=hh1a02Q3xQA+BGg9vzFCzEbm0zCprxM0eEKJ5kNjFIwHsi455l64iZBCm51iNS+ke/ KeMG85zkvR48arOfyh9bO/QAA+BGgu8Ri8rnltMASg2yeT2zToZVrHua2b3Gx1OrnI+e wIlBMpihymu6wST7NEhnm8EF6OcJ9F9hrbkSkOAJF13/9B0xXqitR94jRc4obs16g84a +zDy45fFvw4kPx0/xC6nETZDWJz0pt4BN+T8KlbClByc3p2Jr8wvR11TVPwEr/n08OPN RGroWw1h7nkj7n9PLSvbi1A3NmVFYzkU+YDVnWzCgnu4wcN9gv1SYon98I3zhBcvq8lT vFqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=eqD049xdLII1J9U9gwtXnfeWZPKVEUgztEiHJeEDXTM=; b=eDzWyhZNA2i0TBbQj858n9YYzDc9tj0xt/fZiIgDIXLwOJbnPW4LicjuqljkTaVka1 ZnFKx7DH6Mde/YrwJ75dOEg+bFky9v9xN4gOkQVgNUGg9oLMXeSDfHXwOMTKv7aQXzp+ AYxTNj6G1DPl4s7ECDjyz+tJ2M5yF/TYhZDptt6bV1fjdDxWAtWbBKBmOGz+8UkxULLJ RjsDHlxzy2PuJXQsS2Ae5GFa1DNdJWRHenxKV1lVkvLuz4vcFlz1kjgTg0rNGHTwb7lU k7tj1YgDeb81H/zBWJRLD1+st4pgeEab5999eouf5qxEqABjIgsJgPyq7NwQe8mfqXPU kpQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t62-20020a638141000000b00517a4a75528si4466611pgd.162.2023.05.10.09.58.52; Wed, 10 May 2023 09:59:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235806AbjEJQn3 (ORCPT + 99 others); Wed, 10 May 2023 12:43:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235757AbjEJQn2 (ORCPT ); Wed, 10 May 2023 12:43:28 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C2B601BB; Wed, 10 May 2023 09:43:26 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ED6FD12FC; Wed, 10 May 2023 09:44:10 -0700 (PDT) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.32.173]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9BF0F3F67D; Wed, 10 May 2023 09:43:23 -0700 (PDT) Date: Wed, 10 May 2023 17:43:20 +0100 From: Mark Rutland To: Douglas Anderson Cc: Catalin Marinas , Will Deacon , Sumit Garg , Daniel Thompson , Marc Zyngier , ito-yuichi@fujitsu.com, kgdb-bugreport@lists.sourceforge.net, Chen-Yu Tsai , Masayoshi Mizuma , Peter Zijlstra , Ard Biesheuvel , "Rafael J . Wysocki" , linux-arm-kernel@lists.infradead.org, Stephen Boyd , Lecopzer Chen , Thomas Gleixner , linux-perf-users@vger.kernel.org, Frederic Weisbecker , "Gautham R. Shenoy" , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 06/10] arm64: idle: Tag the arm64 idle functions as __cpuidle Message-ID: References: <20230419225604.21204-1-dianders@chromium.org> <20230419155341.v8.6.I4baba13e220bdd24d11400c67f137c35f07f82c7@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230419155341.v8.6.I4baba13e220bdd24d11400c67f137c35f07f82c7@changeid> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 19, 2023 at 03:56:00PM -0700, Douglas Anderson wrote: > As per the (somewhat recent) comment before the definition of > `__cpuidle`, the tag is like `noinstr` but also marks a function so it > can be identified by cpu_in_idle(). Let'a add this. > > After doing this then when we dump stack traces of all processors > using nmi_cpu_backtrace() then instead of getting useless backtraces > we get things like: > > NMI backtrace for cpu N skipped: idling at cpu_do_idle+0x94/0x98 As a heads-up, this is only going to work in the trivial case where a CPU is within the default cpu_do_idle(), and not for anything using PSCI cpu_suspend() (which I'd *really* hope is the common case). That doesn't get inlined, and the invocation is shared with other SMCCC users, so we probably need more work there if culling idle backtraces is important. I'm not averse to this change itself. Mark. > Signed-off-by: Douglas Anderson > --- > > Changes in v8: > - "Tag the arm64 idle functions as __cpuidle" new for v8 > > arch/arm64/kernel/idle.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/kernel/idle.c b/arch/arm64/kernel/idle.c > index c1125753fe9b..05cfb347ec26 100644 > --- a/arch/arm64/kernel/idle.c > +++ b/arch/arm64/kernel/idle.c > @@ -20,7 +20,7 @@ > * ensure that interrupts are not masked at the PMR (because the core will > * not wake up if we block the wake up signal in the interrupt controller). > */ > -void noinstr cpu_do_idle(void) > +void __cpuidle cpu_do_idle(void) > { > struct arm_cpuidle_irq_context context; > > @@ -35,7 +35,7 @@ void noinstr cpu_do_idle(void) > /* > * This is our default idle handler. > */ > -void noinstr arch_cpu_idle(void) > +void __cpuidle arch_cpu_idle(void) > { > /* > * This should do all the clock switching and wait for interrupt > -- > 2.40.0.634.g4ca3ef3211-goog >