Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3302737ybh; Mon, 16 Mar 2020 20:27:49 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvEXtaHJrn5dUbshdQGirFp9JqyfilSjHlS/M/84Ei62twxGGDI0ugn8t4DFevLs6XqBKJx X-Received: by 2002:a9d:4001:: with SMTP id m1mr1915514ote.57.1584415669795; Mon, 16 Mar 2020 20:27:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584415669; cv=none; d=google.com; s=arc-20160816; b=oy7ZwZWVtLJ6pe8FKBKV4VbrX3j2YJRajhqOjwFUZdirgM5+iHvZ8TVYmP3/HMRCnl RHzW+ssYoSB3ZF/6dnNJVWkd24yeRyQPpSMXVSEaYd5yhBx12VKIYJ7cDsPgYqzN1edg RCm/pzlf2TpsqtZe4ft+x9tNiClN05EOCY9po5S3aa1PcWMRCN1pgfwwQC/74VCWb1/6 sUvqwIp527YmkBy4Ig/WiPYHDwfjzhWKKfeWeAqWbFrgVb9XbsP+dPdwlG7X31esnJNC YrRt1ArnIifHP3vT0WlSE6dCWscFPzwcYXnzBWI3BOIvyhJpRFJ3dyn8jGVH6k0KFyZj 9/8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qYzsFQul7XctVPY5JwH7zSO9+d5x1eixlhOf4FDnb04=; b=XK9grw7ZMesBiLhplwIqAS3DUkz8UOkbcI5Z/mDpqaHaHCd4ICwtjrwAVdRh8e1Woe wrQaUJqfCHl8EcEjFC66Z8WsWdn1/LyNCEnnIuWAiAVT4JW3UoIKmqOsMKjbIKrcDSOs aSFidXrCGF9lUT3+uaa3eeYiOENPYq7OcGwCHNAb8oKiRvwj89HsHdSTDu3wJpelosRx aFw9u1M+krLv2eYyKIBSo2OCVbdNcbDcZ2MYDTyNppW8VdEykTqQNWC8vh3lkM1YfXD/ 20O5iHx26uIzKppXb0CtyYa7Xwh7bNbVoqsShyjZcMHRPaaUb3TAEJS+nZzhzKUkuRoF Izbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dNTTYFpD; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c5si1012872otm.104.2020.03.16.20.27.37; Mon, 16 Mar 2020 20:27:49 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dNTTYFpD; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726596AbgCQCSY (ORCPT + 99 others); Mon, 16 Mar 2020 22:18:24 -0400 Received: from mail-pj1-f65.google.com ([209.85.216.65]:34337 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726082AbgCQCSW (ORCPT ); Mon, 16 Mar 2020 22:18:22 -0400 Received: by mail-pj1-f65.google.com with SMTP id q16so1954031pje.1 for ; Mon, 16 Mar 2020 19:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qYzsFQul7XctVPY5JwH7zSO9+d5x1eixlhOf4FDnb04=; b=dNTTYFpDw2Rq52vC6Rt8JDGMz1N7SfvkWjLgoHSzbs6n9KnXZKYpIgaASTSH2xm21P Nif1djfW1GVY+Gp5VCM0Qb07qhQTDu0bdNvY4kZ4ifBCIviI9rSqiAghh7t0HbgF2DFQ 8drsNUcW1ZXwne53kdSiGJqE4lFUeJxop96c1RsHpV9/OHxpmJ3RwiB8ArDIuAGyInUO gGy58ls/+DuDXP2KNV2R6RdMqj5COpHQ9awNu4LuOR4DXuAUmezctHuguyZ1CPKLu0N4 T1pLAOd5CvDB2mXNXfIwFc8cJR7RZYWBr9tdud4w/ZbzV+3p4ArZkIy43YGvwJQ5KjRW CuQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=qYzsFQul7XctVPY5JwH7zSO9+d5x1eixlhOf4FDnb04=; b=hS2Wz8s1yudpyssIoukFj8f+pU+vj9BJcGEi8fsANwOxm1rGuKNKPe9USVgjUyFLDM hGJ5662q0cCHaAISPa71T+NS/PF6pc0kias+rMA2DOXWcwIUm3SUQJYee2gRHLdS+jZV 26L1oQkU5pda4S517UEHctCGWbth5A4uYtr5QNBIfCTLDEoHY4jVo4M5t9WRRRt+W7uP b+oIJN4smGmPUH00zKvL7sq7XbPCS1ClnUtAnwD8rymjg4QK2v1oRB2K2U0QnmkKcGW9 gNY3j5SwNgRkg3OS8t8P/VSNpAK341SPejNL7/N28deCvhVy8FviOvm9edGILM7h4APE ad9g== X-Gm-Message-State: ANhLgQ22kHDtg4S35mO4gO6dG5sQXSV39dGCodvfC6p2s7EZpGe1svIQ CvjiMZjm95vVknP1GY7Y2C4= X-Received: by 2002:a17:90a:4487:: with SMTP id t7mr2629686pjg.104.1584411501611; Mon, 16 Mar 2020 19:18:21 -0700 (PDT) Received: from localhost ([2401:fa00:8f:203:5bbb:c872:f2b1:f53b]) by smtp.gmail.com with ESMTPSA id w124sm1086610pfd.71.2020.03.16.19.18.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 19:18:20 -0700 (PDT) Date: Tue, 17 Mar 2020 11:18:18 +0900 From: Sergey Senozhatsky To: Eugeniu Rosca Cc: linux-kernel@vger.kernel.org, Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Jisheng Zhang , Valdis Kletnieks , Sebastian Andrzej Siewior , Andrew Gabbasov , Dirk Behme , Eugeniu Rosca Subject: Re: [RFC PATCH 3/3] watchdog: Turn console verbosity on when reporting softlockup Message-ID: <20200317021818.GD219881@google.com> References: <20200315170903.17393-1-erosca@de.adit-jv.com> <20200315170903.17393-4-erosca@de.adit-jv.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200315170903.17393-4-erosca@de.adit-jv.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (20/03/15 18:09), Eugeniu Rosca wrote: [..] > @@ -428,6 +428,8 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer) > } > } > > + console_verbose_start(); > + > pr_emerg("BUG: soft lockup - CPU#%d stuck for %us! [%s:%d]\n", > smp_processor_id(), duration, > current->comm, task_pid_nr(current)); > @@ -453,6 +455,8 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer) > if (softlockup_panic) > panic("softlockup: hung tasks"); > __this_cpu_write(soft_watchdog_warn, true); > + > + console_verbose_end(); > } else > __this_cpu_write(soft_watchdog_warn, false); I'm afraid, as of now, this approach is not going to work the way it's supposed to work in 100% of cases. Because the only thing that printk() call sort of guarantees is that the message will be stored somewhere. Either in the main kernel log buffer, on in one of auxiliary per-CPU log buffers. It does not guarantee, generally speaking, that the message will be printed on the console immediately. Consider the following example: CPU0 CPU1 console_lock(); schedule(); watchdog() console_verbose_start(); printk() log_store() if (!console_trylock()) return; console_verbose_end(); ... console_unlock() print logbuf messages to the consoles we missed the console_verbose_start/end on CPU1 IIRC, we had a similar approach in the past. See commit 375899cddcbb26 ("printk: make sure to print log on console"). And we reverted it, see a6ae928c25835 ("Revert "printk: make sure to print log on console."). -ss