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 X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3604BC10F14 for ; Tue, 8 Oct 2019 13:13:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F129C20815 for ; Tue, 8 Oct 2019 13:13:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F129C20815 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 88C798E0008; Tue, 8 Oct 2019 09:13:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 83DD88E0003; Tue, 8 Oct 2019 09:13:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7534C8E0008; Tue, 8 Oct 2019 09:13:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0102.hostedemail.com [216.40.44.102]) by kanga.kvack.org (Postfix) with ESMTP id 53D8E8E0003 for ; Tue, 8 Oct 2019 09:13:54 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id C6126500F for ; Tue, 8 Oct 2019 13:13:53 +0000 (UTC) X-FDA: 76020659946.19.yard62_3f14da5215158 X-HE-Tag: yard62_3f14da5215158 X-Filterd-Recvd-Size: 2911 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Tue, 8 Oct 2019 13:13:53 +0000 (UTC) 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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