Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp384258pxh; Wed, 10 Nov 2021 03:23:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGQJnYF5rXhpiExzUGPggKpGLp9QXhd/3V/HaUREApZqEBzNtgOF1r9RvXRWWy7F1xJC/y X-Received: by 2002:a17:906:5811:: with SMTP id m17mr19574710ejq.289.1636543390544; Wed, 10 Nov 2021 03:23:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636543390; cv=none; d=google.com; s=arc-20160816; b=wr0OnNjgaB9vFrM2F17VBYbxbkY2BoyQ2uD1ODVatFUkZhHd2BXrf/drZnPSCAKOqB Ccgle4+0hrdYZ/OSv8AsAvZtELFzxZMhknJ9rQojVYTJGTxk1HP2hZpPTAihBcEgC6h2 BfNdwow0YOHosJl7MNXKHshfcpXgM/g8a5vPxbNjMmFa3FHOy3asf5uSdrz6sRnjW+xo 0OwYGVZMDKgLn2B4+36tERoY5N9DD403WJ+dFkv9v9gVuuuYa3maXkPostcx459BbRhD fiSnRovubff294kPv8bNsf4nmadHejQZasSF2gbPkgKknvbZbtK96L1eeWL5GSJOuE7L +diA== 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=CKdGRMTGsWn9HCBQ5Oi6SxJ1ad0n9MyScVi4CuS0mWM=; b=sPQCBBr1m7DA2Q+2BDP+xHmszjxlYvKsGBHcpHTw9uwZLkEYK4gxNILfhfAP0XObdX qAniUlptHLnbWgGSFlGVuLWQco8liQ0ZLwWKRhT37eLRXyf9HEVBmGo7GJbsrMKt4z6k dFBqMgfsKrGemg9hX64PqnYtRUt3kXJlbJ3g20Q7vBEi5LmulT5pg8rJleU13TzF3BHs AKnj8LAayqXe3Ekz0cU4Yjq0KZ3qY0K6+g9is1+zcf59ONHw5VkXBbf+Ax/Ps3E681HJ vFtcO0uAVqNK3OZSt/t6h8apDlFOPouffmYH6+A4UptU9pxqBN9oyn79w7lpRtxUAQ0Y hOkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=qxVhBfi8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y6si41054092edp.593.2021.11.10.03.22.44; Wed, 10 Nov 2021 03:23:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=qxVhBfi8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231312AbhKJLXd (ORCPT + 99 others); Wed, 10 Nov 2021 06:23:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbhKJLXd (ORCPT ); Wed, 10 Nov 2021 06:23:33 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5803DC061764 for ; Wed, 10 Nov 2021 03:20:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=CKdGRMTGsWn9HCBQ5Oi6SxJ1ad0n9MyScVi4CuS0mWM=; b=qxVhBfi88ggtGutV0mk23qAID+ DqTtqFaZuebEIRAbDCmFVl2EDZn7kj7b83mbuV3XY+7417TPHZNnhHO7vmj26qpz3uFBeKKn/WRx2 j2isy8Cd+1jyuOELDU0W00EG2u+7KjZZr/TGjNqZqG5lqXhg3SUmNTSPiGej1Oqawr5jwbRsZ8zhE Lt91QO8lAr/lE0UcgWMYZv9u2TiR1azxNRgcetmUql5yBH3qefh3JGRRr1tjgFZC+C7WMzsL0OiSp GSb7pySq+6oaDqIBnfFfHF8+LDnPA3mrHsd/AdszMJomO0hW+UZmBkFRH3jhz4iHYk4O3v8Q1ERAE 6yq/xbIQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkleB-001ohi-VO; Wed, 10 Nov 2021 11:20:08 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id AC4963000A3; Wed, 10 Nov 2021 12:20:05 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8E7E8214EB9C2; Wed, 10 Nov 2021 12:20:05 +0100 (CET) Date: Wed, 10 Nov 2021 12:20:05 +0100 From: Peter Zijlstra To: Petr Mladek 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 , John Ogness , Juri Lelli , Kees Cook , linux-kernel@vger.kernel.org, Maarten Lankhorst , Maxime Ripard , Mel Gorman , Sergey Senozhatsky , Steven Rostedt , Thomas Zimmermann , Tony Luck , Vincent Guittot Subject: Re: printk deadlock due to double lock attempt on current CPU's runqueue Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 10, 2021 at 11:50:38AM +0100, Petr Mladek wrote: > On Tue 2021-11-09 12:06:48, Sultan Alsawaf wrote: > > Hi, > > > > I encountered a printk deadlock on 5.13 which appears to still affect the latest > > kernel. The deadlock occurs due to printk being used while having the current > > CPU's runqueue locked, and the underlying framebuffer console attempting to lock > > the same runqueue when printk tries to flush the log buffer. > > > > I'm not sure what the *correct* solution is here (don't use printk while having > > a runqueue locked? don't use schedule_work() from the fbcon path? tell printk > > to use one of its lock-less backends?), so I've cc'd all the relevant folks. > > At the moment, printk_deferred() could be used here. It defers the > console handling via irq_work(). I think I've rejected that patch at least twice now :-) John's printk stuff will really land real soon now, right.