Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6481128rwr; Mon, 24 Apr 2023 21:58:48 -0700 (PDT) X-Google-Smtp-Source: AKy350ZfRDWbog0yigWzP3liKP7k8gSgKLrapGl+03LCOfZVL7FfdLmOMjIDN83SzaLq4cNHbTeK X-Received: by 2002:a17:902:d2d2:b0:1a6:9d98:e763 with SMTP id n18-20020a170902d2d200b001a69d98e763mr22243725plc.26.1682398727994; Mon, 24 Apr 2023 21:58:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682398727; cv=none; d=google.com; s=arc-20160816; b=oiPNV1ro3hBLBn8ovxx7SKEuJ0dal9mDW9SRug6hb3ckvwKiVtmUvDvrqOLxzqW+kP EJdUCQ0ZnqC9jZTT170Ya/8GHzzbIzKIKqAClFoQNX579jOfY4zoOYTb+cKNpj9z8Nl9 AOFr4ZYkbpyHdAtfjcJFZoxaHeetJuZDHokTzYxjVavPj0Gtk2fBTN/E74NPTDsTB935 /X0xonk2zbSGEpUxKs2pi6okEYZ1nU/Zg1lhD/uusgCG8mkgi+fs0adGVy8AhjkuG+hi jCn73fZspBuox2XaCNtEuvUCrp0g2Fmz8XKvvRFN7dj5ayhsQII3uaRQmLBzulyVhW1V +/Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=vKKkeNYy26t1TjKVwBgMLbds1eKVkw1hMyFByHcDzQ8=; b=ANNofbyuMvuGQ0I5EeiHmibmNvmEpNz96D8CnG1O+khLjq+UAPu5753Hue7cBrMLFL XjOmpMOjKAo+8m9IYz1ClHeKHlwXOhQRCR5cf1f6B8Zha+uaAmCwv6opyXHXYtpE36MY 1VacUCfH6afri/TUhfOpp3/EyCj8OYDjkutNDjBZ3ZQriVLW+AnoDvRHcBZcOps+WLhV tlgzH8VyB5GvROcDh3fftRU6z/J7f+PF6O8njXGOEKx7ZyprJM2F889PAew8bqEGXw/Y ppuTblJ5+zeMIX98CUx9zs4BxZIUVp2MiY8gKeC3cAau/6UC1DftFwEToKATYVj5Kpy2 5Wdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dClWn8nq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u23-20020a1709026e1700b001a980a2b405si2124017plk.471.2023.04.24.21.58.32; Mon, 24 Apr 2023 21:58:47 -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; dkim=pass header.i=@chromium.org header.s=google header.b=dClWn8nq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232290AbjDYE6Q (ORCPT + 99 others); Tue, 25 Apr 2023 00:58:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbjDYE6O (ORCPT ); Tue, 25 Apr 2023 00:58:14 -0400 Received: from mail-ua1-x933.google.com (mail-ua1-x933.google.com [IPv6:2607:f8b0:4864:20::933]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2B1183CB for ; Mon, 24 Apr 2023 21:58:13 -0700 (PDT) Received: by mail-ua1-x933.google.com with SMTP id a1e0cc1a2514c-779701b7265so1801376241.2 for ; Mon, 24 Apr 2023 21:58:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1682398692; x=1684990692; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=vKKkeNYy26t1TjKVwBgMLbds1eKVkw1hMyFByHcDzQ8=; b=dClWn8nq9rhEMd87NqePK0FRmC3PDIyZw3hNI4Y6kWzhsoOdCrl23hkYVmMtLxs0eB BAsWynnRwqY4Uo2vZFhLHqfVcBHwutaEM3DB0UweV6tlcoX/qc9tPAOSt26d7bl6hIsE hUu9Hw6PAg8ceY58RXg9Sl/hl1RlCY7CY8vhw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682398692; x=1684990692; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vKKkeNYy26t1TjKVwBgMLbds1eKVkw1hMyFByHcDzQ8=; b=LUPsfw7hNYjEtY9TNFJecB4hyzX66737R9Bwm2pOIOCQ8kGjdOb2T1PNZVFIJwnTBT +CqkP8yh8KIHj0cHIYkPnNnPjvCb4V/IGnOHxlchO1PINMcEZl9Nm8Xl2cFrXr7fFpSL sWbI4pR1jna8T+QhUEbBzpKHt6DrMk/x7Nce5DH1zp+2najtUGHFbcVD3LBFoIz5dqG3 9N8cJBfbPoiK9eoYxhCoy3m0zWIuMyVPupDdg1am0+arOJ3j568Unbdb2kqkX021pzUa aBlYjauq2yDv3DF1Gxt+jS2K69QDnGNgWTLFlI0g13GBmNxO2aN94tqy+a+xhArxaRsf lrLQ== X-Gm-Message-State: AAQBX9fNP8wFundi5+lAAXdiUn6ruzj7vLmNDYzLmi+CDVHQTpX9Da+6 cRl61ovnlV4zn/PqhLMOL5JSzsNRmUAtve8R+ZHggg== X-Received: by 2002:a1f:cb02:0:b0:43f:a097:5e8c with SMTP id b2-20020a1fcb02000000b0043fa0975e8cmr3429523vkg.16.1682398692723; Mon, 24 Apr 2023 21:58:12 -0700 (PDT) MIME-Version: 1.0 References: <20230421155255.1.I6bf789d21d0c3d75d382e7e51a804a7a51315f2c@changeid> <20230424125355.GA4054@aspen.lan> In-Reply-To: From: Chen-Yu Tsai Date: Tue, 25 Apr 2023 12:58:01 +0800 Message-ID: Subject: Re: [PATCH] hardlockup: detect hard lockups using secondary (buddy) cpus To: Doug Anderson Cc: Daniel Thompson , Petr Mladek , Andrew Morton , Lecopzer Chen , Stephen Boyd , Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org, kgdb-bugreport@lists.sourceforge.net, Marc Zyngier , linux-perf-users@vger.kernel.org, Mark Rutland , Masayoshi Mizuma , Will Deacon , ito-yuichi@fujitsu.com, Sumit Garg , Catalin Marinas , Colin Cross , Matthias Kaehlcke , Guenter Roeck , Tzung-Bi Shih , Alexander Potapenko , AngeloGioacchino Del Regno , Dan Williams , Geert Uytterhoeven , Ingo Molnar , John Ogness , Josh Poimboeuf , Juergen Gross , Kees Cook , Laurent Dufour , Liam Howlett , Marco Elver , Matthias Brugger , Michael Ellerman , Miguel Ojeda , Nathan Chancellor , Nick Desaulniers , "Paul E. McKenney" , Peter Zijlstra , Randy Dunlap , Rasmus Villemoes , Sami Tolvanen , Stefano Stabellini , Vlastimil Babka , Zhaoyang Huang , Zhen Lei , linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Mon, Apr 24, 2023 at 11:42=E2=80=AFPM Doug Anderson wrote: > > Hi, > > On Mon, Apr 24, 2023 at 5:54=E2=80=AFAM Daniel Thompson > wrote: > > > > On Fri, Apr 21, 2023 at 03:53:30PM -0700, Douglas Anderson wrote: > > > From: Colin Cross > > > > > > Implement a hardlockup detector that can be enabled on SMP systems > > > that don't have an arch provided one or one implemented atop perf by > > > using interrupts on other cpus. Each cpu will use its softlockup > > > hrtimer to check that the next cpu is processing hrtimer interrupts b= y > > > verifying that a counter is increasing. > > > > > > NOTE: unlike the other hard lockup detectors, the buddy one can't > > > easily provide a backtrace on the CPU that locked up. It relies on > > > some other mechanism in the system to get information about the locke= d > > > up CPUs. This could be support for NMI backtraces like [1], it could > > > be a mechanism for printing the PC of locked CPUs like [2], or it > > > could be something else. > > > > > > This style of hardlockup detector originated in some downstream > > > Android trees and has been rebased on / carried in ChromeOS trees for > > > quite a long time for use on arm and arm64 boards. Historically on > > > these boards we've leveraged mechanism [2] to get information about > > > hung CPUs, but we could move to [1]. > > > > On the Arm platforms is this code able to leverage the existing > > infrastructure to extract status from stuck CPUs: > > https://docs.kernel.org/trace/coresight/coresight-cpu-debug.html > > Yup! I wasn't explicit about this, but that's where you end up if you > follow the whole bug tracker item that was linked as [2]. > Specifically, we used to have downstream patches in the ChromeOS that > just reached into the coresight range from a SoC specific driver and > printed out the CPU_DBGPCSR. When Brian was uprevving rk3399 > Chromebooks he found that the equivalent functionality had made it > upstream in a generic way through the coresight framework. Brian > confirmed it was working on rk3399 and made all of the device tree > changes needed to get it all hooked up, so (at least for that SoC) it > should work on that SoC. > > [2] https://issuetracker.google.com/172213129 IIRC with the coresight CPU debug driver enabled and the proper DT nodes added, the panic handler does dump out information from the hardware. I don't think it's wired up for hung tasks though. ChenYu