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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E368C433F5 for ; Wed, 10 Nov 2021 10:14:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D609F61168 for ; Wed, 10 Nov 2021 10:14:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D609F61168 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E39196EDE8; Wed, 10 Nov 2021 10:14:51 +0000 (UTC) X-Greylist: delayed 428 seconds by postgrey-1.36 at gabe; Wed, 10 Nov 2021 10:14:49 UTC Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id E37026EDDD for ; Wed, 10 Nov 2021 10:14:49 +0000 (UTC) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1636538858; 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=6H3iJsYLymZGZdTTPIwaF3WwOUQj7EWnfPhR6PY5oWA=; b=i97ffLNgZOCzWFBRclG7GYiqXi7MHOrZxbOXgJo0pTV9VaaVPhnG7NnoN6yM3YQF/vW6FC /3gyS9iBsC5urXBvXaYF49NEiCksYHVOTalS1S/1WP1VfMlkHIkSawA/Ap8njZ2dqksKpL LqdnqRoK4lkmtv0Nz56XOk+A2fQ6Qr/lejEAUjmBko0vER8YoFp+rdooaaLKYDMEXhtJoH jx7lE1sPblbEaXau0X5Qe99u1WmUZbWkd/MsTkgcxhkOaB1uhw+41/cBH3eVL3dFXAOQqw J6WbiaGNlGR9igGy7y9MoRYhexo0UfhlV76JID34cVRgrVSIGg+lt80o8j0N5Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1636538858; 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=6H3iJsYLymZGZdTTPIwaF3WwOUQj7EWnfPhR6PY5oWA=; b=ee6Y2TYLMpo7uGsr+qYoymWA2RnXgQ7bpfSm69n5Kv+JYUF4RpPSJ2gC9dckYjRQ6jAAGr HFIj1zE58dGl46AA== To: Daniel Vetter , Peter Zijlstra Subject: Re: printk deadlock due to double lock attempt on current CPU's runqueue In-Reply-To: References: <20211109213847.GY174703@worktop.programming.kicks-ass.net> Date: Wed, 10 Nov 2021 11:13:37 +0106 Message-ID: <87fss4wcgm.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Juri Lelli , David Airlie , dri-devel@lists.freedesktop.org, Ben Segall , Sultan Alsawaf , Vincent Guittot , Anton Vorontsov , Ingo Molnar , Mel Gorman , Petr Mladek , Kees Cook , Steven Rostedt , Dietmar Eggemann , Tony Luck , linux-kernel@vger.kernel.org, Sergey Senozhatsky , mkoutny@suse.com, Thomas Zimmermann , Colin Cross , Daniel Bristot de Oliveira Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 2021-11-10, Daniel Vetter wrote: > I'm a bit out of the loop but from lwn articles my understanding is > that part of upstreaming from -rt we no longer have the explicit "I'm > a safe console for direct printing" opt-in. Which I get from a > backwards compat pov, but I still think for at least fbcon we really > should never attempt a direct printk con->write, it's just all around > terrible. Right now we don't have an explicit "I'm a safe console for direct printing" option. Right now all printing is direct. But it sounds to me that we should add this console flag when we introduce kthread printers. > So yeah for fbcon at least I think we really should throw out direct > con->write from printk completely. Even after we introduce kthread printers, there will still be situations where direct printing is used: booting (before kthreads exist) and shutdown/suspend/crash situations, when the kthreads may not be active. I will introduce a console flag so that consoles can opt-out for direct printing. (opt-out rather than opt-in is probably easier, since there are only a few that would need to opt-out). Since kthread printers do not yet exist (hoping to get them in for 5.17), I am not sure how we should address the reported bug for existing kernels. John Ogness 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C384C4332F for ; Wed, 10 Nov 2021 10:07:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 00CD9611F2 for ; Wed, 10 Nov 2021 10:07:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231168AbhKJKK2 (ORCPT ); Wed, 10 Nov 2021 05:10:28 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:41954 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230440AbhKJKK0 (ORCPT ); Wed, 10 Nov 2021 05:10:26 -0500 From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1636538858; 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=6H3iJsYLymZGZdTTPIwaF3WwOUQj7EWnfPhR6PY5oWA=; b=i97ffLNgZOCzWFBRclG7GYiqXi7MHOrZxbOXgJo0pTV9VaaVPhnG7NnoN6yM3YQF/vW6FC /3gyS9iBsC5urXBvXaYF49NEiCksYHVOTalS1S/1WP1VfMlkHIkSawA/Ap8njZ2dqksKpL LqdnqRoK4lkmtv0Nz56XOk+A2fQ6Qr/lejEAUjmBko0vER8YoFp+rdooaaLKYDMEXhtJoH jx7lE1sPblbEaXau0X5Qe99u1WmUZbWkd/MsTkgcxhkOaB1uhw+41/cBH3eVL3dFXAOQqw J6WbiaGNlGR9igGy7y9MoRYhexo0UfhlV76JID34cVRgrVSIGg+lt80o8j0N5Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1636538858; 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=6H3iJsYLymZGZdTTPIwaF3WwOUQj7EWnfPhR6PY5oWA=; b=ee6Y2TYLMpo7uGsr+qYoymWA2RnXgQ7bpfSm69n5Kv+JYUF4RpPSJ2gC9dckYjRQ6jAAGr HFIj1zE58dGl46AA== To: Daniel Vetter , Peter Zijlstra Cc: Sultan Alsawaf , Anton Vorontsov , Ben Segall , Colin Cross , Daniel Bristot de Oliveira , Daniel Vetter , David Airlie , Dietmar Eggemann , dri-devel@lists.freedesktop.org, Ingo Molnar , Juri Lelli , Kees Cook , linux-kernel@vger.kernel.org, Maarten Lankhorst , Maxime Ripard , Mel Gorman , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Thomas Zimmermann , Tony Luck , Vincent Guittot , mkoutny@suse.com Subject: Re: printk deadlock due to double lock attempt on current CPU's runqueue In-Reply-To: References: <20211109213847.GY174703@worktop.programming.kicks-ass.net> Date: Wed, 10 Nov 2021 11:13:37 +0106 Message-ID: <87fss4wcgm.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 2021-11-10, Daniel Vetter wrote: > I'm a bit out of the loop but from lwn articles my understanding is > that part of upstreaming from -rt we no longer have the explicit "I'm > a safe console for direct printing" opt-in. Which I get from a > backwards compat pov, but I still think for at least fbcon we really > should never attempt a direct printk con->write, it's just all around > terrible. Right now we don't have an explicit "I'm a safe console for direct printing" option. Right now all printing is direct. But it sounds to me that we should add this console flag when we introduce kthread printers. > So yeah for fbcon at least I think we really should throw out direct > con->write from printk completely. Even after we introduce kthread printers, there will still be situations where direct printing is used: booting (before kthreads exist) and shutdown/suspend/crash situations, when the kthreads may not be active. I will introduce a console flag so that consoles can opt-out for direct printing. (opt-out rather than opt-in is probably easier, since there are only a few that would need to opt-out). Since kthread printers do not yet exist (hoping to get them in for 5.17), I am not sure how we should address the reported bug for existing kernels. John Ogness