Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5644144ybp; Tue, 8 Oct 2019 06:16:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJwpBCIhZBwE2cV5PkQywoJmR/dSmKzG9ipxY3WVHnuN0/8GUl/ol1AdLQ9ANDR5mpbDy9 X-Received: by 2002:a50:9438:: with SMTP id p53mr34029011eda.291.1570540607913; Tue, 08 Oct 2019 06:16:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570540607; cv=none; d=google.com; s=arc-20160816; b=Ev9Ufa/Hbcb4tqMhz5c91zyx7o/O2HWkUY+WKMC98lRtGvbtbrtpLHeMQX8u559Jpd zYqWzJvqbON5gv4UDJ+og2FLJLLXaLtmRyfxYLlaaXYi2fbx/KBX9haFmISdL1JDnq08 WUu0NDfPUkwDeoR2vpPMHvRvDpWZNMQitFDgB68vxSs10R3IWRbNbtXtaqQ/sSgdRVQX yKqBQlQniT73MnMhTH6oiPoYuTs4BLaKhZPDKi0fTtzSVKAA82g438wmX+kjivw51qwc Pm54W6lQwWX8qw5fuCOAx2cLKFZ8b8axFdKlIrvMCUmyObSbdsGZ2nxStQlwMRYh5Zgh sPxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=UNdoQVDnbLZtgdCresFbPItwr3jJeUImnRD2Uq+t0YA=; b=0kT1D7iHxY7QEWZYDHFnCVf7hS5xJgUCbM5ch3rwm4NrKinUdkPrgyIhmw5EjxM4o5 LyRiTHGKL8I8Y+MwLCAkSvHZazutJ1Eqyqk7okklSp8acsVCgUSSMznxuP9ROVI0Fexq Mpa4jhAPQsS4m3lGu4HSxbJFzlVL9JXHba0sd09PdUdnoBYTVaJPG27fxNJAS/Kh+yXd QCp1UGLYiRj205BzuhtjzuMOHzO0zHvH8Yolq7H13TRg2BS42+IYGtiu45YW/XDHQKeu RFjlw6ejPV1x5zSj35T305uwOJu2heriKGNt4HFybSvWphmbsiZr0JdRMt6i4+y8rp1b xKGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j34si10019994ede.10.2019.10.08.06.16.24; Tue, 08 Oct 2019 06:16:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730889AbfJHNNx (ORCPT + 99 others); Tue, 8 Oct 2019 09:13:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:51574 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730371AbfJHNNx (ORCPT ); Tue, 8 Oct 2019 09:13:53 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8060A206BB; Tue, 8 Oct 2019 13:13:51 +0000 (UTC) Date: Tue, 8 Oct 2019 09:13:49 -0400 From: Steven Rostedt To: Petr Mladek Cc: Qian Cai , Michal Hocko , sergey.senozhatsky.work@gmail.com, peterz@infradead.org, linux-mm@kvack.org, john.ogness@linutronix.de, akpm@linux-foundation.org, david@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm/page_isolation: fix a deadlock with printk() Message-ID: <20191008091349.6195830d@gandalf.local.home> In-Reply-To: <20191008081510.ptwmb7zflqiup5py@pathway.suse.cz> References: <1570228005-24979-1-git-send-email-cai@lca.pw> <20191007143002.l37bt2lzqtnqjqxu@pathway.suse.cz> <1570460350.5576.290.camel@lca.pw> <20191007151237.GP2381@dhcp22.suse.cz> <1570462407.5576.292.camel@lca.pw> <20191008081510.ptwmb7zflqiup5py@pathway.suse.cz> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 8 Oct 2019 10:15:10 +0200 Petr Mladek wrote: > There are basically three possibilities: > > 1. Do crazy exercises with locks all around the kernel to > avoid the deadlocks. It is usually not worth it. And > it is a "whack a mole" approach. > > 2. Use printk_deferred() in problematic code paths. It is > a "whack a mole" approach as well. And we would end up > with printk_deferred() used almost everywhere. > > 3. Always deffer the console handling in printk(). This would > help also to avoid soft lockups. Several people pushed > against this last few years because it might reduce > the chance to see the message in case of system crash. > > As I said, there has finally been agreement to always do > the offload few weeks ago. John Ogness is working on it. > So we might have the systematic solution for these deadlocks > rather sooner than later. Another solution is to add the printk_deferred() in these places that cause lockdep splats, and when John's work is done, it would be easy to grep for them and remove them as they would no longer be needed. This way we don't play whack-a-mole forever (only until we have a proper solution) and everyone is happy that we no longer have these false positive or I-don't-care lockdep splats which hide real lockdep splats because lockdep shuts off as soon as it discovers its first splat. -- Steve