Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5567871ybv; Tue, 11 Feb 2020 18:50:46 -0800 (PST) X-Google-Smtp-Source: APXvYqwVJGNUibMzWfn1oLI4jeVmeFVT2Coaic+msAcn5A4uTZzCqYY5hCEPJEvZzJzHvVcf+fLY X-Received: by 2002:a9d:6b91:: with SMTP id b17mr7212499otq.235.1581475846496; Tue, 11 Feb 2020 18:50:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581475846; cv=none; d=google.com; s=arc-20160816; b=e8bv7CbGAVgay9EiESPqpy8DbBdJrbWhAJ6NN1j04uYKteDOOh7SVjAn708Wg0iHQ2 /bFybX7lsVKT7Fk3LrmPpWCSEEnkzYISYn7cFYKWNgPgO2ZnBlF/wyef8ZoXlCGpcxDQ sNTJxZo2crqh6hLQWFnZbku8PNsOWkrEbIfDM++qgqVZh1LXa7v7xWUJBF7+wXXwCaAh ynlPfL3O4f8v5vl50hFojvHLl66mkakxi69b+D5mTFB/IF4WjWo7tzMRXRupoOwf90ZQ jVYZrG7BFeSNT6RoBACT1cXQSVgM1tFBO5yomCmaPxTv1xnRxFw6BGgTlMrktYES1Ool vnhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=FwRv96q9oQM8oDfFJ4ptaDSEAXgkQmSpjna3FKXMKVI=; b=WBsGYyDYgKvhgNLZfjZaFZ14aaH/1vOUbKWqbkYXldjjVBz6H8vEjVe5KY93j1QKwT MqssCMR2Rw28T5sNL9+o+HZC/kOKq84l9mRDQOqhoNvwTigmSjHE2PciWqx31JrVChG3 1pp/+cpNd6XyJYoy8fsAvyuUeEEkYWnih+hpgFyJORQKbmZru5cHTu1UZN0Jc9egLutQ HCS3S76u8+/BYkx5bkB9upvpQ5S+Osc3oMNbcWwWK/rdrnh6rv/zgd2NGt5M3nId1PwX W8aadkCg7MXYxwDzkyopUMV6JuWWh1nHfJyMzcvAw/R1/BdVqEmlNG/u5ZAuEGJ6JnA4 K7Dw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g25si2948795otj.198.2020.02.11.18.50.33; Tue, 11 Feb 2020 18:50:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727600AbgBLCuB (ORCPT + 99 others); Tue, 11 Feb 2020 21:50:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:32978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727565AbgBLCuB (ORCPT ); Tue, 11 Feb 2020 21:50:01 -0500 Received: from rorschach.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4449420724; Wed, 12 Feb 2020 02:50:00 +0000 (UTC) Date: Tue, 11 Feb 2020 21:49:58 -0500 From: Steven Rostedt To: Sergey Senozhatsky Cc: Petr Mladek , Peter Zijlstra , linux-kernel@vger.kernel.org, Sergey Senozhatsky , Andrew Morton , Dmitry Monakhov , Konstantin Khlebnikov Subject: Re: [PATCH] kernel/watchdog: flush all printk nmi buffers when hardlockup detected Message-ID: <20200211214958.5d8f4004@rorschach.local.home> In-Reply-To: <20200212011551.GA13208@google.com> References: <158132813726.1980.17382047082627699898.stgit@buzz> <20200212011551.GA13208@google.com> X-Mailer: Claws Mail 3.17.4git76 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 12 Feb 2020 10:15:51 +0900 Sergey Senozhatsky wrote: > On (20/02/10 12:48), Konstantin Khlebnikov wrote: > > > > In NMI context printk() could save messages into per-cpu buffers and > > schedule flush by irq_work when IRQ are unblocked. This means message > > about hardlockup appears in kernel log only when/if lockup is gone. > > > > Comment in irq_work_queue_on() states that remote IPI aren't NMI safe > > thus printk() cannot schedule flush work to another cpu. > > > > This patch adds simple atomic counter of detected hardlockups and > > flushes all per-cpu printk buffers in context softlockup watchdog > > at any other cpu when it sees changes of this counter. > > Petr, could you remind me, why do we do PRINTK_NMI_DIRECT_CONTEXT_MASK > only from ftrace? Could it be because its from ftrace_dump() which can spit out millions of lines from NMI context? -- Steve