Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp494471imn; Tue, 26 Jul 2022 01:09:00 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sRpEmpZABuu/yLoGqeqjlIQgXw3Jx2ZK88iMrZ8YH0+3fueK7+OG3TF5U5AbDCrU8vPPP8 X-Received: by 2002:a63:8b4b:0:b0:412:96f4:f154 with SMTP id j72-20020a638b4b000000b0041296f4f154mr14118470pge.281.1658822939851; Tue, 26 Jul 2022 01:08:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658822939; cv=none; d=google.com; s=arc-20160816; b=MLt+0x9or7CIh4eSm6ADnGhjdgomAds86ER02ee30gfTwEbGxWWuFx+jm+6B9D8Jrn jj68+H9O8cu/DamPsGDvVPaX90XVVNUyE2Lmvv04/0X7dfVqZF1bEHu+8fn1F9Je8AiF vZQB10f9DPGb0oZgyzbnElp/PAUMTvwL0H3V/VdY0aAixIpdaFlrfyvoeHJmYz3TbWMM ytOWIeVo4U4KNT5eCJjsA3zUgJbQj0eST1BncJUB4zv4pruIsheV4vR0LnNRuILKX4eF Y38LGEe4SI7uMkpXpGjnsSn0C4jN7d5iOW0ncyPsFrJ6NMbggyC0xAJmE4hdKmY7iv0/ Xmpw== 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=uUxOHR9ruyvarDL+n99COropQfzZw5hQeHs+l5NpGBA=; b=wHxWCJtomfrlBc973RbjodNds1VPlp8ipd9o/k8OGzlH0b3A1ayigRsRtKKT2+vBxt bSbMQwRGyO3VYapmjaxndLRZ/5Ilx7kZPOSmtrKnMcdzEGSYHIJ4iU39smxXOLQICspb FrIv4p5fsjLymzi9+1Aai6M1NJcjXqbsIZhE/lLtK6xbMDBnPCMgx75vx+RMDk3M6tc8 jh2eVzJ8+qRV05W6J+Cdx7ISMD32vLcWtivMNp6fqZHw67Mq/+PkukNZARvJ5GXMcWbR VJZGCM2UZAOw62cFMKM7j5VMU9193wolcdw0VPuxrz5UOwyUjaeMDOwwHdklibOHoE5n ox2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ICsMZJtB; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m7-20020a1709026bc700b0016c65bbf115si15036571plt.131.2022.07.26.01.08.45; Tue, 26 Jul 2022 01:08:59 -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=@linutronix.de header.s=2020 header.b=ICsMZJtB; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231466AbiGZH5o (ORCPT + 99 others); Tue, 26 Jul 2022 03:57:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbiGZH5m (ORCPT ); Tue, 26 Jul 2022 03:57:42 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEE041ADBD for ; Tue, 26 Jul 2022 00:57:41 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1658822260; 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=uUxOHR9ruyvarDL+n99COropQfzZw5hQeHs+l5NpGBA=; b=ICsMZJtBquGqNUAbBt1NkCf4RuWUtK8WKuw+rCOhsAtXtGgDVT+d7Ghnpwe7l6ggssrxKg QpXketqEDg76S7bDm16R54St8NhitP7NhDpBs5v8xjt1+05SCMDgdTQ8a44lw6qTcTeZ13 NVwfdz+FvK3vwWcLEkbc4MRlnx42K6hJvmUI4/EFDBzRk0KK2G2WDj7crSy65sOQFDdr6T /AW9VGkYH9lQNNqgRzjJ7FJZImLe521z/KrSYfbaRjzsEPYA79Ou1ddFETZcA2ZMatoedy OzUw3zhsqsLYsMsRyjeMuNgLlC3a6niDwTM7fyWP39on3nAgCohAJeabasR3iQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1658822260; 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=uUxOHR9ruyvarDL+n99COropQfzZw5hQeHs+l5NpGBA=; b=Qc0wgGxaT9mjo4CZ1wpwJnnFqbZ6q/m3RiaTniZS67QmsmAo9I6VF3TpC8+x28Me8gbkm+ S2M7S7qUFoIVegDw== To: Sebastian Andrzej Siewior , Petr Mladek Cc: linux-kernel@vger.kernel.org, Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner Subject: Re: [PATCH v3] printk: Skip console drivers on PREEMPT_RT. In-Reply-To: References: <87y1wn3g3g.fsf@jogness.linutronix.de> <87ilnrn06u.fsf@jogness.linutronix.de> Date: Tue, 26 Jul 2022 10:03:39 +0206 Message-ID: <871qu8i9vw.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 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 2022-07-25, Sebastian Andrzej Siewior wrote: > printk might be invoked in a context with disabled interrupts and or > preemption and additionally disables interrupts before it invokes the > console drivers. This behaviour is not desired on PREEMPT_RT: > - The console driver are using spinlock_t based locking which become sleeping > locks on PREEMPT_RT and must not be acquired with disabled interrupts (or > preemption). > > - The locks within the console drivers must remain sleeping locks and they must > not disable interrupts. Printing (and polling for its completion) at 115200 > baud on an UART takes too long for PREEMPT_RT in general and so raises the > latency of the IRQ-off time of the system beyond acceptable levels. > > Skip printing to the console as temporary workaround until the printing threads > and atomic consoles have been introduced or another solution which is > compatible with the PREEMPT_RT approach. > With this change, the user will not see any kernel message printed to the > console but can retrieve the printk buffer from userland (via the dmesg > command). This allows enable PREEMPT_RT as a whole without disabling printk and > loosing all kernel output. Note that "the dmesg command" is not the only userspace tool to access the kernel logs. Logging daemons (using /proc/kmsg or /dev/kmsg) also have full access. > Disable console printing on PREEMPT_RT. > > Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: John Ogness