Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5675193ybp; Tue, 8 Oct 2019 06:44:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZlsXH4lsnyFM5p/q04JA2GIefP9ENEprm1Jhm75DOByjRSZ5MV9ybXYQCeje2wfB6H8PB X-Received: by 2002:a50:981b:: with SMTP id g27mr34323254edb.105.1570542252055; Tue, 08 Oct 2019 06:44:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570542252; cv=none; d=google.com; s=arc-20160816; b=XrbDh5CCaIb8fb9fXYSr0xwT/T5IgctzyNY4MRmeLjXimnWZ5j8pvVfSoz414Mtsgj FszkJ6N1+vkhnhVmInvg3QkReQL/2J3jggatmcJEwcuRyjwDLqiQzFwvGIgXtr/p4vzp 64bJ/rudzis+L+xxumgzOhic5AyfRPLEIroAdXYvzprEnK7GrNggIldAG6YTZPKhc1Zd qT4mfTPnqio8O0c7c+o+WkJjqaF0Kn9yIeWkJ8c8NkySdZRuYhMZDaXIWsBhDJUuJMAj YOSe/AJLpyxXEaXwfdLgbPQJPJcArALYkPjEFL7PwUGVsvrxw4k/3c7s02H4wsS5ql6k bM2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=M0KGyYbrzHfUiUvPDmsV4YyDEC5yzc95Rjd/Xm/AJII=; b=GWMxJbuWX50e6sj7sfLjxeMFLoV1jI6aoyESojQf5JB70FkPhF5EQAzDakAuEE4SEQ iApOWcP5o+0pwq0xa4C6rrDYkRcaQce7C5f4FTmaqpexat9nDsp/0FqQuJG6N18vLgEv acyhr4WHCPMDK15p0ToJNiiM/cl9paO7kJ8QjJchanXaeAtLitHYTLURx32wM9lVrOWo jOyQgY2fy4EztsT4vUAPWYXnrpJylg9gG+48h0u4FVVnJ25Eo93y9X0o0LG6aFTOR8wq 62WV069K9eXnZa204R7lFqWKGWNudKMHw28DLDF0BkQEqpMLkTJxRoRXMvWJyMSmE+jy /5iw== 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 w1si9632698edt.288.2019.10.08.06.43.48; Tue, 08 Oct 2019 06:44: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; 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 S1726111AbfJHNm6 (ORCPT + 99 others); Tue, 8 Oct 2019 09:42:58 -0400 Received: from mx2.suse.de ([195.135.220.15]:43446 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725821AbfJHNm6 (ORCPT ); Tue, 8 Oct 2019 09:42:58 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8B3BDB1AB; Tue, 8 Oct 2019 13:42:56 +0000 (UTC) Date: Tue, 8 Oct 2019 15:42:56 +0200 From: Petr Mladek To: Qian Cai Cc: Steven Rostedt , sergey.senozhatsky.work@gmail.com, peterz@infradead.org, Michal Hocko , 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: <20191008134256.5ti6rjkvadn5b5q4@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> <20191008091349.6195830d@gandalf.local.home> <1570541032.5576.297.camel@lca.pw> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1570541032.5576.297.camel@lca.pw> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 2019-10-08 09:23:52, Qian Cai wrote: > 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. No, the resistance was against complicated code changes (games with locks) and against removing useful messages. Such changes might cause more harm than good. I am not -mm maintainer so I could not guarantee that a patch using printk_deferred() will get accepted. But it will have much bigger chance than the original patch. Anyway, printk_deferred() is a lost war. It is temporary solution for one particular scenario. But as you said, there might be many others. The long term solution is the printk rework. Best Regards, Petr