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.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 CA03DC10F14 for ; Tue, 8 Oct 2019 13:23:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 85B52206C0 for ; Tue, 8 Oct 2019 13:23:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lca.pw header.i=@lca.pw header.b="Lu5t9332" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 85B52206C0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lca.pw Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2DF8A8E0005; Tue, 8 Oct 2019 09:23:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 290658E0003; Tue, 8 Oct 2019 09:23:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1A7078E0005; Tue, 8 Oct 2019 09:23:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0106.hostedemail.com [216.40.44.106]) by kanga.kvack.org (Postfix) with ESMTP id EE0348E0003 for ; Tue, 8 Oct 2019 09:23:55 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 8F54B824CA30 for ; Tue, 8 Oct 2019 13:23:55 +0000 (UTC) X-FDA: 76020685230.15.shade25_51f304ad9500 X-HE-Tag: shade25_51f304ad9500 X-Filterd-Recvd-Size: 5086 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Tue, 8 Oct 2019 13:23:55 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id e15so10373701qtr.4 for ; Tue, 08 Oct 2019 06:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=7Q4s6NaffGbR5MTwYJR6kw9AA12T9aVl8HZYwAcmo7U=; b=Lu5t9332sw3rkpQ77idM5uwOZSTizPp/2c2Rp1i2nsuuZRt+0OoReF8QYw4QrIkH9j MocrxC3BarR1EMhUfZbA1OmqvVpDV5ilFiIj3vaOwLWimihWr6R/umtjBG89Ky+w6Uth mncmokFAaWDQMdXs6dq9yzQUE/EXTPE55IfIBVFlvVxHV1xgKArsQxxcgAbLKrlJIhQN sxK5OsyOFD9hOeNp3NEq7TnK9DcREo7ruUau94/ECzT0gFxJr71oAxt1GUXnqImp5QVB /bmtw95UKHmFKWZpK6dgTvbYS+S6yn/kidr6teEzqqTgZSTN/0byuo6uH2havtCNoCML iwig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=7Q4s6NaffGbR5MTwYJR6kw9AA12T9aVl8HZYwAcmo7U=; b=ao8pstFS6+plGZjyIDhiGx8Lr9uBGNW1aHxXTvfVFU44HRglL1UuS9YDlaF69HAvgP Kub4ZbCXnP1UfljzvZkSFL3nwTdoIvURjfAEdL6WawAKe4/3jyyjaOJ91MC9fG3pKplr PbXYyJTZ4EqwHWj+np5dhDTt4UfX+HtFMASOslkNkwMw+7rVbjHGzYqnty3Dk3IELyNE zErrkqWGU+EmdPudoeqrlt1N8nNVEZYSpRjEE6xJ3RIb4+WfI0V4+lj6s6Dh+Tt/1PBj n5VvdMsmgOiCe9Krx/R331dWR362ZJOJp3lMEW1CYUofxcViTwtmjP6dI2R9M1LrXnY3 KTug== X-Gm-Message-State: APjAAAUBCpAYRG5iAUsVyc30LKUiYEOX0e+5mov8LKMrlcVjvkBUoWNG NxkKlV5l6y8qijyJ8QxcH26efw== X-Google-Smtp-Source: APXvYqyqj9bfnctaJsILCG/S8S9eIkRiOJXvoK9od3JlzBHgJYL8rQe3cIU9ce69hQodM7iUFmpHJw== X-Received: by 2002:ac8:4594:: with SMTP id l20mr35506879qtn.286.1570541034449; Tue, 08 Oct 2019 06:23:54 -0700 (PDT) Received: from dhcp-41-57.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id e7sm9048646qtb.94.2019.10.08.06.23.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Oct 2019 06:23:53 -0700 (PDT) Message-ID: <1570541032.5576.297.camel@lca.pw> Subject: Re: [PATCH v2] mm/page_isolation: fix a deadlock with printk() From: Qian Cai To: Steven Rostedt , Petr Mladek Cc: 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 Date: Tue, 08 Oct 2019 09:23:52 -0400 In-Reply-To: <20191008091349.6195830d@gandalf.local.home> 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> <20191008091349.6195830d@gandalf.local.home> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 (3.22.6-10.el7) Mime-Version: 1.0 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, 2019-10-08 at 09:13 -0400, Steven Rostedt wrote: > 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. I feel like that is what I trying to do, but there seems a lot of resistances with that approach where pragmatism met with perfectionism.