Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp344801rdb; Thu, 5 Oct 2023 07:37:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYqbuWx+7gkI2p424fVD5pe6ZEI8uuQUYtaah1Q1vUkspBTQLgEgAJeECiA8GThez1l76f X-Received: by 2002:a17:902:9a44:b0:1be:384:7b29 with SMTP id x4-20020a1709029a4400b001be03847b29mr4990910plv.34.1696516657302; Thu, 05 Oct 2023 07:37:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696516657; cv=none; d=google.com; s=arc-20160816; b=FLmMFuOnOtLWITdtaWIIIKICJIDmhtDL1EnTJPL+eU/lS5HZ4xEnaU/FCD3PZzYph6 08iCinA7qoHX4Umf1CfKl6eCVw1zGwL27HNSmoTU79a3r4BLrEZYSuTxUi6nJzc4Hvrl TpFWAudSOh39Zs/fWCIAD8BiMG1lxAlMM4FzgBFBg/E0m1asNxI6UhVigkjAc/9VyPvs o16LFXjC9NGgWKOvfti2qqXcAH5IOb66WSYUOcmlmm9OdJO/ytHN7sfyWQvTzcWEvi/h JwP7sO/KsEQBilw2nrJGYjPulofVhx10Q+bJgtPBlcU0NSagrVZdiJ4es/2J7vZvLk/n UYZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=HefGVIbKSQ3vy0UfHqATp/KOc0Tq42iQ8ydZMVaCb8c=; fh=pKnPKUsir0uEGSsor+4Zc2vgbu+g+ayvUgsdzkuXaoA=; b=GOSIHbs7eD8/Iz7c1RHKof21FnNu8Y9IBPhS+umdpXgnO6qW6vJax7Ih0cGulKsOqH iwUxSsGrvraRFfqiorPB8PM327z+bSHU9Zz1dVeMPHfi2hnainMR4xigUUFy1hAnnTIG iP/4vzcemBQ+Pqv9AjfwO+ROCAmHskqhS/VsZWo5vP+VFlD+UjRVOC7xWrc2C65z9Anw o92XL3rm1jiIrwjDDDp3YR1JD7rAJjZLgi6TH4jQKSJPx97u4ufk3LkjKKqSUeyJ+fdP TqCpvxTM6eV4kL4oS5J3eRLgxcJhQdojnmvBXeF/Fjv8cFCjCIDyIleH7JYghcz/Z59k jXFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=2IOGzdwZ; dkim=neutral (no key) header.i=@linutronix.de header.b="1/71++pw"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id d4-20020a170902cec400b001c5e0672f53si1668275plg.466.2023.10.05.07.37.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 07:37:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=2IOGzdwZ; dkim=neutral (no key) header.i=@linutronix.de header.b="1/71++pw"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id EA92385C574D; Thu, 5 Oct 2023 07:37:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236886AbjJEOhR (ORCPT + 99 others); Thu, 5 Oct 2023 10:37:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235193AbjJEOfD (ORCPT ); Thu, 5 Oct 2023 10:35:03 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB8303698 for ; Thu, 5 Oct 2023 06:59:35 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696514369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HefGVIbKSQ3vy0UfHqATp/KOc0Tq42iQ8ydZMVaCb8c=; b=2IOGzdwZ9qsltc3VzYE5j9y4RlFQIW+YWutgC088wz01n3Py2dlZKPMcULBCz3J8dnWdDm wmcHGtou++xiMX0rRUTH+LFd91FQB4XwfLVj8EJyXCytcjTu8G7PvpiFewq1Yy5gWF5FS3 hDwGDcg4x/ceGWomUCNzbP7mMWS/dusbAJWSM/0cx9iqOYVNDPQQCPwdjhkwsEWt4LVWZp 0IdB+KBN+ECync+My5OTb4iWCReS51X1RDfyM1uDfNQtSUqhOdeZR3OLAkv+mCqaYe+Vta Vf4t+yUMXd0M80tFMnDDHTYOw4pXsW0ToClQygy0ZnCnK9QFRiLe6PkZt0VceQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696514369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HefGVIbKSQ3vy0UfHqATp/KOc0Tq42iQ8ydZMVaCb8c=; b=1/71++pw1ukYqHa6TixEjX6KNLofwMzjRdS+fyU0Bi3JqPyvnDfRRZ0vOZFf/XTaa3gQPH J/R2VRFsS3JWZ5CA== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH printk v2 06/11] printk: nbcon: Wire up nbcon console atomic flushing In-Reply-To: References: <20230919230856.661435-1-john.ogness@linutronix.de> <20230919230856.661435-7-john.ogness@linutronix.de> <87a5tabchs.fsf@jogness.linutronix.de> Date: Thu, 05 Oct 2023 16:05:27 +0206 Message-ID: <87edi9tbk0.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 05 Oct 2023 07:37:35 -0700 (PDT) On 2023-09-26, Petr Mladek wrote: > Anyway, the proposed behavior (agreed on LPC2022) seems > to contradict the original plan from LPC 2019, see > https://lore.kernel.org/all/87k1acz5rx.fsf@linutronix.de/ > Namely: > > --- cut --- > 3. Rather than defining emergency _messages_, we define an emergency > _state_ where the kernel wants to flush the messages immediately before > dying. Unlike oops_in_progress, this state will not be visible to > anything outside of the printk infrastructure. > > 4. When in emergency state, the kernel will use a new console callback > write_atomic() to flush the messages in whatever context the CPU is in > at that moment. Only consoles that implement the NMI-safe write_atomic() > will be able to flush in this state. > --- cut --- > > We wanted to flush it ASAP. In 2019 we didn't have all the code yet. Yes, we assumed that flushing each individual printk() call would be how to do it. But in 2022, during a live demo with real code, we saw that it was a bad idea. I disagree that the 2022 decisions are contradicting the 2019 decisions. We have added more details because now we have a real implementation. v2 establishes an emergency state before dying. v2 flushes the messages safely before dying (and unsafely _immediately_ before dying). v2 flushes the messages in whatever context the CPU is in. v2 uses write_atomic() to perform the flush. John