From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4200DC43334 for ; Mon, 13 Jun 2022 08:30:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240191AbiFMIaR (ORCPT ); Mon, 13 Jun 2022 04:30:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240133AbiFMIaG (ORCPT ); Mon, 13 Jun 2022 04:30:06 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 015841EEEE for ; Mon, 13 Jun 2022 01:30:05 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1655109004; 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=6YfnLzYsqZtamSjbgNwE+1ANi1MPYoPaKZoAdpL94tw=; b=hMmvLEA9wdH4JtDJgIxNxkW2RXXNNGD8Lr77myJVcqgaQ63kOnywlv0jw6uxfeP46TUdI/ 1TMf8TFZiecKgBBYJe1epnQSfxYGBvuWZui8dlkAbwsGnFCtMdUSqnBo+7cpH2b9iVHec7 fW4aymmZXiD+Y8IJbFPmg70Mqnz9p+qLrGWkO+6QxGiAfeiUpFqlw3/FBcaRGrmbJSWfWs zSvMNsUfOSMihPMQdWDcujqv89AVPaajgxtsEY0+aumTkEHoP6PgPqLRKkUX/UU7bqGJkL nfhAUb1LAvIghjXQNW1VhLZmjV6waAO+4Zr4rjZw1cT8OGNV2AsLO74pQ1Ib0Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1655109004; 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=6YfnLzYsqZtamSjbgNwE+1ANi1MPYoPaKZoAdpL94tw=; b=2oMoKyLTPflIXvN07qwsObNwKxLTDbvA8y9Jb7G9YBK/VlwEC+s+JMYPZ/LVx/9DuoRTkC ckDyn8X8BQQEwCCQ== To: Sergey Senozhatsky Cc: Sergey Senozhatsky , Petr Mladek , Peter Geis , Linux Kernel Mailing List , "open list:ARM/Rockchip SoC..." Subject: Re: [BUG] Threaded printk breaks early debugging In-Reply-To: References: <87y1y48spg.fsf@jogness.linutronix.de> <8735g9mqo0.fsf@jogness.linutronix.de> Date: Mon, 13 Jun 2022 10:36:04 +0206 Message-ID: <87wndlge43.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-06-13, Sergey Senozhatsky wrote: >> > Should a situation when we have only one online CPU be enough of a >> > reason to do direct printing? Otherwise we might not have CPUs to >> > wakeup khtread on, e.g. when CPU that printk is in atomic section for >> > too long. >> >> 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. 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. 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. John Ogness