Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp281078pxb; Fri, 8 Jan 2021 05:02:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwGPbMnzqSUuwfQhKMsumZPfdK2zTeI+/AGUKXWddlXjRyz08X3LOCHOc5YtZdCCO2CT5+ X-Received: by 2002:a05:6402:ca1:: with SMTP id cn1mr5218921edb.128.1610110951936; Fri, 08 Jan 2021 05:02:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610110951; cv=none; d=google.com; s=arc-20160816; b=EAZOLcqbtajcZbA/hzSxu22z7/t0aF13bcDyCOM+0uSHzERUgs/ap/9wrhSmGTk+hN AotvSAX7NHB5s7hly42ypRAjgvJvQcjtUKAbCeoMVzZNwHFqWMU9OkX4PpF2UFI+RUbx VtZMUUCwn3kEK3lmKTtUT+7kz5psfd3serqPBGXoKesJXJJDc94DLbEd/JtF7g5NFjns BXZkDGkOgWmJH7+m7+zsbd4b3JKoDlCVi+dINnxune00Oj58VYZx3M24LHm7B/cSj+QQ 2beKlTdlYzkMvG8qtgSf1EaldW702xWF+3Aa9Lj7Fi5kMq/9MhwNEplcmX3kEWcwlk/B lfBQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5Yldxc0OHRlCNDcj3L0XTRzCQ6O7egbVLgrLXwd0ce8=; b=dR6vU0EJvI5pQ4Fr9ftVLBCHdSSvbb3U/qa8z1NLs7h8Rpl3ddQq2WdDwD7KDkwzfQ YE45TX6cGuFE/KXX7NEyIdlIxJtMCxGvVqt2zJOpIf6EPUDPxf92lEdASZpAqT5X+6xU B2kq0TqcCykbF4K3+5f7k4KgtlyfeEP1Cl0vCh5ucTSzA1p9q6ngT2HO/b1I8eLru+45 A7QCNbokPhJsv91F7NiJMTF1R/xQryJoEvpuihMuZTI/dEG1bdtB9dlaKQUymQfVLt0C 8Z1I+79d+f6MCdzDUZcM0k/9MtIOlWMZTylRQdKPTb1uOkAYT5mumE6ls2SW71OZGvVD yCqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=IpaH2U2C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z23si3580452edx.444.2021.01.08.05.02.02; Fri, 08 Jan 2021 05:02:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=IpaH2U2C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727502AbhAHNAX (ORCPT + 99 others); Fri, 8 Jan 2021 08:00:23 -0500 Received: from mx2.suse.de ([195.135.220.15]:54868 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726545AbhAHNAW (ORCPT ); Fri, 8 Jan 2021 08:00:22 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1610110775; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5Yldxc0OHRlCNDcj3L0XTRzCQ6O7egbVLgrLXwd0ce8=; b=IpaH2U2C4KytjMFsk4Z09JJ8CY0zNleghWfR79SrQ20XVO7EtBqXqZAnIZR0tv55232OfP JUxYMJmLinRpet54BceSZtXp3GsjSf2337LGj24IB56R00kYBbxLDWzYyd9k6ManmVmWcP azJcIE/PvRm5mKJk7wQadKtBrz9jrjE= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 525F1AD62; Fri, 8 Jan 2021 12:59:35 +0000 (UTC) Date: Fri, 8 Jan 2021 13:59:34 +0100 From: Petr Mladek To: William Roche Cc: Sergey Senozhatsky , linux-kernel@vger.kernel.org, John Ogness , Peter Zijlstra , Steven Rostedt , Andrew Morton , Thomas Gleixner , Borislav Petkov Subject: Re: [PATCH v1] panic: push panic() messages to the console even from the MCE nmi handler Message-ID: References: <1609794955-3661-1-git-send-email-william.roche@oracle.com> <71663639-e66e-b938-4ded-8e2dc07830b5@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <71663639-e66e-b938-4ded-8e2dc07830b5@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 2021-01-08 01:26:06, William Roche wrote: > On 06/01/2021 05:35, Sergey Senozhatsky wrote: > > On (21/01/04 16:15), “William Roche wrote: > >> @@ -271,9 +280,8 @@ void panic(const char *fmt, ...) > >> */ > >> atomic_notifier_call_chain(&panic_notifier_list, 0, buf); > >> > >> - /* Call flush even twice. It tries harder with a single online CPU */ > >> - printk_safe_flush_on_panic(); > >> kmsg_dump(KMSG_DUMP_PANIC); > >> + panic_flush_to_console(); This is wrong. kmsg_dump() flushes the messages into the registered dumpers, e.g. pstore. It handles only messages in the main log buffer. printk_safe_flush_on_panic() must be called before. It moves any pending messages from the temporary per-CPU buffers into the main log buffer so that they are visible for the dumpers. > > Why? > > Here, we are supposed to push the pending messages, as I could verify > that they don't reach the console until the console_unblank(). So I > wanted to push them with panic_flush_to_console() before the possible > upcoming __crash_kexec() call. I do not see how the ordering of printk_safe_flush_on_panic() and kmsg_dump() would change anything for the upcoming __crash_kexec() call. Best Regards, Petr