Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp432645iog; Mon, 13 Jun 2022 05:56:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyJ7Q21aSSZIZvDVhe8fDDdj/hD7brpOV8g7n47dkReCScNt+SPKIYxl0lALX7nrshGiq3 X-Received: by 2002:a17:907:1c91:b0:711:c834:754c with SMTP id nb17-20020a1709071c9100b00711c834754cmr37996494ejc.85.1655124993747; Mon, 13 Jun 2022 05:56:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655124993; cv=none; d=google.com; s=arc-20160816; b=dCM4NB7GGEwGKmNJ7TpdoXvHLp4y1iRBv6KQTC9tlO06hMMQegjdo4zQK+TNpqAtll qAzu+DDi7zj4scBF5Dq0PCFp0sxsFfT4k3npFbJxA7H+rOb/vyMa9Q72xKYq3Fb+WTYh capgQ80rIHUJWak/C3Rkc/n1HkcQ4s7QuVlxFIgOv782gZ1pi1qgp/KWtMh+Lh7l2YQS WZgDTO6ifyHFUpFqkSfkBcXylWCjCAeAVXpUqAsGfOvKcIoZFlHi9oXWD+tInO9Z2lzG LjjBbjvxulHlLklPIWgJx+D+wMTCJwwR6C385uQ+VVq9OLNsh6aLqz9LLkZI/RNyK63c yO3A== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8A1SBt7Y4ENgqL4eImjxK6vltqR5eYeh6JFaCiLr7vA=; b=VWspOvYN80roTXpLc1p2o9E+OxOfYSdfmIiZTXPgfzL4HUuGD6MQuC9ZVgE76RegOK LJYuR8ziGMDNh6kzQ//1hv8TMN3j++BRErSWcczBSN0lQ2PblbKrxJkoDStzhCF4jJBm a/3DKzHXGqp/TRseLBmzve818TaQum6kh5QW35hNtYMbKiY1V5divyBdghe8Eg5cNL8D NElTraA/GOwM5deWXcp2V9l9pEa3/BIeVoS9NCyXvqDKV0yB80Cau9MFAKv+YG/5rm2v 8pQq4d9o3f1/WRjJ+qqw8Tgs0W4NbGhAtq/pdZx0b+vAPcdN3HYXdjcxm6PuEOJXRufi 8B8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=XEIaa7to; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bd1-20020a056402206100b0042b370f9819si6651566edb.552.2022.06.13.05.56.09; Mon, 13 Jun 2022 05:56:33 -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=@suse.com header.s=susede1 header.b=XEIaa7to; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241479AbiFMKOl (ORCPT + 99 others); Mon, 13 Jun 2022 06:14:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236358AbiFMKOR (ORCPT ); Mon, 13 Jun 2022 06:14:17 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F32C2F72 for ; Mon, 13 Jun 2022 03:14:15 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id B481B21D51; Mon, 13 Jun 2022 10:14:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1655115254; h=from:from:reply-to: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=8A1SBt7Y4ENgqL4eImjxK6vltqR5eYeh6JFaCiLr7vA=; b=XEIaa7toxjzMzmVz63x8m/Bpz29asC1XFMDzDOXMWlSSE/4ReiaKbx5luU5EL1s71vEGjb MV3HE9NpUiJSOf2bpEKQjUPEkTT8jliDvnD0E1jO++E86f768apChswS7pPvdQGUEFrQGC G6pZM5KHDslkiRb0FnVSVU1b3+9IJ/Y= Received: from suse.cz (unknown [10.100.201.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 82DAF2C142; Mon, 13 Jun 2022 10:14:14 +0000 (UTC) Date: Mon, 13 Jun 2022 12:14:14 +0200 From: Petr Mladek To: Sergey Senozhatsky Cc: John Ogness , Peter Geis , Linux Kernel Mailing List , "open list:ARM/Rockchip SoC..." Subject: Re: [BUG] Threaded printk breaks early debugging Message-ID: References: <87y1y48spg.fsf@jogness.linutronix.de> <8735g9mqo0.fsf@jogness.linutronix.de> <87wndlge43.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 2022-06-13 18:05:08, Sergey Senozhatsky wrote: > On (22/06/13 10:36), John Ogness wrote: > > >> IMHO, no. Especially in that situation, we do not want printk causing > > >> that atomic section to become even longer. If the machine has entered > > >> normal operation, we want printk out of the way. > > > > > > At the same time printk throttles itself in such cases: new messages are > > > not added at much higher pace that they are printed at. So we lower the > > > chances of missing messages. > > > > That is true if there is only 1 printk caller. > > Well, which is the case when num_online_cpus() == 1? Good question. Well, it would be nice to have the same behavior on single CPU and SMP systems. Blocking atomic context with slow console is bad even on single processor system. If there are problems with lost messages then we will need a solution for SMP anyway. > > For SMP systems with printing handovers, it might not help at all. > > I firmly believe that sprinkling randomness into printk (i.e. system) > > latencies is not the answer. We need to keep printk lockless and out > > of the system's way unless there is a real emergency happening. > > Yeah sure. > > > This particular thread is not about missed messages due to printk not > > "throttling the system", but rather the kernel buffers not getting > > flushed in an emergency. This, of course, needs to be properly handled. > > True, but Peter mentioned > > "I noticed with threading enabled during large bursts the console > drops an excessive amount of messages. It's especially apparent > during the handover from earlycon to the normal console." But this is also the situation when softlockups happen. It should ideally be solved with a big enough buffer. Another interesting alternative is the Peter Zijlstra's mode where all messages are printed to the console "immediately". They are serialized only by the CPU-reentrant lock. This mode is not good for production system. But it might be good for debugging. The good thing is that the behavior is well defined. I hope that we will get this mode with the atomic consoles. Best Regards, Petr