Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp510606pxh; Wed, 10 Nov 2021 05:24:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJw09UnNvDdxwuVhV8fHNIUEh8SrnqVGxy0vhovhIF3WUIsgHktarS6QQuu4QZIbFGX6I0sx X-Received: by 2002:a05:6402:892:: with SMTP id e18mr21586852edy.84.1636550687745; Wed, 10 Nov 2021 05:24:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636550687; cv=none; d=google.com; s=arc-20160816; b=b6xkHjOn7HIQtj9HuFjiiVZhgZa/PzKklEa7WsorCGT4iNZ1gisZs0r7+RZfdzJ5dF BT3CAhMUw8G6zt5X056e4HO4UQvgdttQ4OzlvTABy+b7Xobg3zv2etGWTC9/5Oy/dcY9 Dq0qOb6WJ9efjDfd/OdsMSYL55TM3LGZpEo2aT0O8x8mQn6g1hO2Kfn3IvdXWnaIee5X urwJkREpxABY7zGMoJpw+wuPLXwnIQlAPgRxFtsjy92XD8q8jgSlvTd+QMXwQSnS4k9l mhml+0yb0ICMM4EZYkV7zTmYTqs4IWxHivQL2e7z6nMV7aG9JAs4LSuagGo6xejWv3FL YWnA== 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:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=9nSHeg+VR13aOu2Z2zxGZikb83vMLSFkcE3p79Vw4NM=; b=l4GBVQkeT4bV+3mJ4+UC6Sd2seWN619EUKabzxutKL2CIBoCkGawvUy+miuwykueGg ya5I/I9GihzsrCDP8bwzCGncZ0AuDOoHdCtEfceCZgOwWMgN7loQ32ASe7T/3i4phgOy cwtC1aMXu6Y5mqUOUM/tUuNld3jOE+mInEJyTJQn6Yu9U4EViGNNIBnpqGp9QjHhzt/B FBY6iTpqQXqA6Hx8+dDp27/hb7r8LEAYmq5wzfnLFtuBpjPSdogVwGHXeWoAgSBR6qoo nUmT2mbANM8pG2J+rZrE6jxavDtGOmltE/z90QUPgcHlmtMeR9L4XPgqRIjzoqdgx6Pp 19Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=Cj8Du9Id; 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 qf24si47341853ejc.251.2021.11.10.05.24.22; Wed, 10 Nov 2021 05:24:47 -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=@ffwll.ch header.s=google header.b=Cj8Du9Id; 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 S231716AbhKJNYY (ORCPT + 99 others); Wed, 10 Nov 2021 08:24:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231162AbhKJNYX (ORCPT ); Wed, 10 Nov 2021 08:24:23 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD627C061764 for ; Wed, 10 Nov 2021 05:21:35 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id c71-20020a1c9a4a000000b0032cdcc8cbafso1948927wme.3 for ; Wed, 10 Nov 2021 05:21:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=9nSHeg+VR13aOu2Z2zxGZikb83vMLSFkcE3p79Vw4NM=; b=Cj8Du9IdyEn04AQkfT9B2aGGW1ckXszoFiPpaRwkZUM74Wnatk1LUBoSWNcHkQbc0o a5Szh5GJJCfZD99PEeQcu6ygFoVYpy1wakuwo5WZogubUzcRUbYUnC2e5PkgzY2KxFfb 6r0CPx4+c7BWPN594V90wjF+d6WPBaLtZBnO8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=9nSHeg+VR13aOu2Z2zxGZikb83vMLSFkcE3p79Vw4NM=; b=thukzkVPoMo6HCGEnXOLML0gWzoiMW5pIxH75GaggGw8y+O4MiDSzjXk04Gc0qllk0 +Y4SOyjF4A4k72h3wvdxPF37/srK4PIwnqLTnk3H/V658X4kw4GzXP90bac6IFKtHtGl xMNvc2IrkI+47HUCSSB6HAM/8JPIXlolwiIWfP5FOnjcwegSSK95U4iPsTGQqO1jkL+x Egym13JLufD+Hw7ryApJzOI6H9VepwmDiwvyEGKoftFxqDe/T19ynfJCzdH1HpFCPS2v HU0hgc4qJPxVmngTsEhMA4qOO7qP211cpPSZWOItj75XH5buPnWJPp/euPGB3HqRQy76 neTQ== X-Gm-Message-State: AOAM531yh3hSeOtZJra9waTqCUvzJ91WTyRzbH408G4ATGl+gC3jsMDG kmtEXHjceSyls0VbSj9TpycmiQ== X-Received: by 2002:a1c:43c2:: with SMTP id q185mr16319206wma.30.1636550494461; Wed, 10 Nov 2021 05:21:34 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id l11sm22401680wrp.61.2021.11.10.05.21.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Nov 2021 05:21:33 -0800 (PST) Date: Wed, 10 Nov 2021 14:21:31 +0100 From: Daniel Vetter To: Peter Zijlstra Cc: Petr Mladek , 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: Mail-Followup-To: Peter Zijlstra , Petr Mladek , Sultan Alsawaf , Anton Vorontsov , Ben Segall , Colin Cross , Daniel Bristot de Oliveira , 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 References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 5.10.0-8-amd64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 10, 2021 at 12:20:05PM +0100, Peter Zijlstra wrote: > 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. Yeah whacking all affected prinkt callers just because of fbcon does not sound like a good idea to me either. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch