Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp673119imn; Tue, 26 Jul 2022 06:31:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1utjBzFmsv6WED7qVk6K8Zo+dm7Ms1I/wphrZHcdwqiATOzWzoU4bdy9aAgmLP5V0XI1Y6Z X-Received: by 2002:a17:907:2888:b0:72b:9449:fa8b with SMTP id em8-20020a170907288800b0072b9449fa8bmr13466845ejc.334.1658842280455; Tue, 26 Jul 2022 06:31:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658842280; cv=none; d=google.com; s=arc-20160816; b=LKZnzzQj0GFOjJS3d+2DDN2j11MA3qQQhCxFVnKts722QXUGCYLzVoCRj5EHrGqq38 As9/BQdUVMIgFtRshe5tyWuY+o7VRrrc1DKA9UCydXSP6Sd/7BlW9VhJgVkJk95B4+7J 3pgJu1uCyZ/eqH4Rdy7F9lP5qhgY6SsY8KEgoxZ5tNgJWfS0+W5X60S7v2yYffTAw1kq PsfKKYF+v22S0U6cKSPRUZxo/YajeHtyqOEzleG+J/rQ7dYTZDBMyZkLBWp9IJv327cN GhRsp2YwR1YCVIgfc/+qAxbRKy4h2oRAg6LYsHePrVke5/XttcGVb0u4M4Q9kQO4XwQp zqbQ== 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=N0Mf3w6yvzM2MyutV14ToAE1WBe4fAbVJxUolfAEBcI=; b=vJMy27PuNM23065VgBWxwWve15Csl0ETzHCtZDCCQp4Spg6UYdYpkTQVzj22QaTZyx xn3Lek0nCrV8P9WNScfG0HA6usZY5jPY12/orfj8oLMPHR1CvU0ltbWKjBrmZ6oHOFXY RJD1i9oJD/4IuWqaNcJo+8EcamdSmicanID5FbIOzKO8EWhajKbem3JNee77LPbSCVlI CNyY5bQEATAryHrwiSd6t6Fy3NZXup78WQLDsvUNRdELBATaWuaUYMjXaKTmq3Mq3cv+ eEOz/1dtBBu9RlyI+DhWdbqNdXQK+KbQCA6U0M9jFXri+GHLLjju8mTlg6/APY10QYpd UClQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=WXOpgB+9; 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 hg4-20020a1709072cc400b00706b9787b43si17189370ejc.319.2022.07.26.06.30.53; Tue, 26 Jul 2022 06:31:20 -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=WXOpgB+9; 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 S233339AbiGZNL0 (ORCPT + 99 others); Tue, 26 Jul 2022 09:11:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232549AbiGZNLZ (ORCPT ); Tue, 26 Jul 2022 09:11:25 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CCD6DFE6 for ; Tue, 26 Jul 2022 06:11:23 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id B6EE737B5B; Tue, 26 Jul 2022 13:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1658841081; 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=N0Mf3w6yvzM2MyutV14ToAE1WBe4fAbVJxUolfAEBcI=; b=WXOpgB+9SBbSRZ0AxRZbKT5tcXqes56BWtDjdda8s/wHC7uJqDqIVIstF2yj4/kyafF1nz lpr+hu0seFBot1Q872Z6aXlcKmJeh4/pWCiCJfG6q5bJN4n3KlkcaW2GOGOe3X4aocvAMP zOAaEYtvbJGvUogwk4dhgH+FQVw+XAM= Received: from suse.cz (unknown [10.100.208.146]) (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 6A55A2C141; Tue, 26 Jul 2022 13:11:21 +0000 (UTC) Date: Tue, 26 Jul 2022 15:11:19 +0200 From: Petr Mladek To: John Ogness Cc: Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner Subject: Re: [PATCH v3] printk: Skip console drivers on PREEMPT_RT. Message-ID: References: <87ilnrn06u.fsf@jogness.linutronix.de> <871qu8i9vw.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <871qu8i9vw.fsf@jogness.linutronix.de> 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 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 Tue 2022-07-26 10:03:39, John Ogness wrote: > 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. I have updated the message when comitting, see https://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git/commit/?h=rework/kthreads&id=c01c1c784a02aaa216524977b294b8834d0ee907 > > Disable console printing on PREEMPT_RT. > > > > Signed-off-by: Sebastian Andrzej Siewior > > Reviewed-by: John Ogness JFYI, the patch has been committed into printk/linux.git, branch rework/kthreads. I am going to add it into the pull request for 5.20. Best Regards, Petr