Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5655418ybp; Tue, 8 Oct 2019 06:26:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqzy2mRaeyQ/BTm2E4qWr1SK/xHK1obYXp72b6cPDfOPIlc7fmewwLcngnELgGbBz9GmRQ72 X-Received: by 2002:a50:918d:: with SMTP id g13mr33926824eda.64.1570541173003; Tue, 08 Oct 2019 06:26:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570541172; cv=none; d=google.com; s=arc-20160816; b=LO+1CgyicT960nYF2kVTyTYcKFvtD+fEMT/Q31aUaDbqG2eIeBEh3Md0mg3gesZTAk /9lRIevllGm6zM9KcrUe4xq5HfLJurRJ26GCbK68av6/bouqFHLcKQwST3ClN//TqdSv wwZz0/QzirA9AUUR4ubbvr3rQvuyMmsLfncZhZOukgPzIikVbcNNC4Q3kxqR62X/Ff1s ckYX/6qc4jTIJjsSLkbXTKVc4cN7UKGMnDBDvArZ9Z/5kwSZ3zV0hb5FwUrUNBYE/Z+c SiLdkcMSo0lgAnTTS8DHj2KYdFQtyue053EhE7GJUutidMe5uFKx4ELTLlvbUB9cwUo9 y3uQ== 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:date:cc:to:from:subject:message-id :dkim-signature; bh=7Q4s6NaffGbR5MTwYJR6kw9AA12T9aVl8HZYwAcmo7U=; b=cKU/zJ1c3odEkO9+xtmUQ3iPuuYLtLABMmhTWEWIEoxNDOXsz3QXYT3pZ0I9RhHL9w TVmsx6BFYY3JwWcPwYRGm5Ha/n9I3X7rUUwKv3LtIjHti5ye47OBGDnk6NI19FCAMSdu w0KfoFZKHUaTCcJ11Q9obgG2GrJ60A/GxurEyRs22ZfnwBc57wX4WNwPVJcFxZfxEiw3 3WFk93R2LcG5WfGTimz5GQBFD4VNokym5+ZkkvTnPTIImk+n8LXSLVLVWfha9z5su6Kv WrdQDeIZwrgfzUiVPd3Ctz0OCVIqstAQZOstJyhImg+G3SRXhCbBvRlPFS+j7Qukxpv4 /x2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=Lu5t9332; 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 t26si10189948edd.184.2019.10.08.06.25.47; Tue, 08 Oct 2019 06:26:12 -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; dkim=pass header.i=@lca.pw header.s=google header.b=Lu5t9332; 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 S1730605AbfJHNX4 (ORCPT + 99 others); Tue, 8 Oct 2019 09:23:56 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:39731 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730249AbfJHNXz (ORCPT ); Tue, 8 Oct 2019 09:23:55 -0400 Received: by mail-qt1-f193.google.com with SMTP id n7so25241501qtb.6 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=XM1iuTCP1scef5EgAcntiFQpEHq4pyV2V5Gnet9gC6wH13J6nKxH9mNc4YqF4jgTF8 UeB/2kqUpj2TsIjf9ZrjxZNUvXacvp6wpT4sq+6qPhduWQIhWs5Oj0gbjonZtg6QEzdk mbF28yakdyHu0Lzkwn+uHueD5meMjt/S5Q1QMwsgWns/CVbkHXQ7FJ/dmMhYiXClbqc9 eIE0NchvyqGMDfyM4AXhDyY9a0ObwqkeG+A5HCno0uOze74KaB5vDhBu2dRX5VeD3u/O w+chAQhc1VdBxNTV+W6ciP5p6cUrnyK8cftkXKOy4SJ7ztaW+csFo1MoPzM78LmD057B QM6Q== X-Gm-Message-State: APjAAAVStI1BdtYc+1AafdM8kv+nznXH+JthursmfQX5E9oK7tUPxCGX iA4k4T3IAVPthPV22c5E/KvKlw== 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.