Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2692069ybp; Thu, 10 Oct 2019 11:07:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyVHUPM9VJwbYpYOzX6Ky1VM6Sc6nkxFc0tX4ZOg65YVueLIyX59H0LGQxARGvnND/q16iw X-Received: by 2002:a05:6402:1b92:: with SMTP id cc18mr9614050edb.129.1570730838495; Thu, 10 Oct 2019 11:07:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570730838; cv=none; d=google.com; s=arc-20160816; b=Bf4Mifldya/Xv/x7qBYAp42gaeYJ5D9BfK3slPFTn7NUeczgOufkGx0ta4m6G4OHjb RjVr9kKP/gDryrVKABSd08APM2CnsloQgMkFu1NQ4JcUAD7X9uldy0w9u7WEi/Qe1jNl wj7hdoQ1MLyigBg9M46tXnuStuHGeokFLq12y3XrsKeLIEGVA0R9Rwf0HluP17s36Ar0 MHdZYBBRTQ5t2EhauAR8zg+AxOcP4232mIHGCsszUePKd03gobOhfoZrsDhPIrFPdA9N VYRsiTc8401suFB/GqdxyqsJlCZFHeEZaPGlTI6KVGZppgMMXevpRs3v3/Jioz4gjkas sBMg== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=01B4xxaMBt27J+J2TfcwQro3M7ixQfAUqmsHydizoDQ=; b=b1u+iwIvEF3cZ+JSbEWumfTW432tsadJ2WARJDv9XKBSzO0lETIQaQkVUEh1aSayj0 00M9+938HhUsinE4Jzu2mW4BSYaqaUD5O47pvTcfl/Q+85AEWMY0juGiH9d27EP1q5l9 R5ST0elW5Md6c3RmbA4bmMS9twM8pQ3ogdc3IVhEyaYL+qIdiNe9KwGmVQsn6lRJvfMI vVaD19WQ37Ax+kJqpAMdRw0tcuegLd5MJhYHq1PYv0h6bPXJAy77Q14+3bhEJLdYNfvS o2MH1x7vtcuYkTVYHWVRfc4T/TnaRSg/IsMiikodfGjYA3T5AsHoN6ZEGUoAzBOtXpcF SFpA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jo18si3784770ejb.27.2019.10.10.11.06.52; Thu, 10 Oct 2019 11:07:18 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726869AbfJJSGa (ORCPT + 99 others); Thu, 10 Oct 2019 14:06:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:37338 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726387AbfJJSGa (ORCPT ); Thu, 10 Oct 2019 14:06:30 -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 2828BAE03; Thu, 10 Oct 2019 18:06:28 +0000 (UTC) Date: Thu, 10 Oct 2019 20:06:26 +0200 From: Michal Hocko To: Qian Cai Cc: Petr Mladek , Christian Borntraeger , Heiko Carstens , sergey.senozhatsky.work@gmail.com, rostedt@goodmis.org, peterz@infradead.org, linux-mm@kvack.org, john.ogness@linutronix.de, akpm@linux-foundation.org, Vasily Gorbik , Peter Oberparleiter , david@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm/page_isolation: fix a deadlock with printk() Message-ID: <20191010180626.GL18412@dhcp22.suse.cz> References: <20191009162339.GI6681@dhcp22.suse.cz> <6AAB77B5-092B-43E3-9F4B-0385DE1890D9@lca.pw> <20191010105927.GG18412@dhcp22.suse.cz> <1570713112.5937.26.camel@lca.pw> <20191010141820.GI18412@dhcp22.suse.cz> <1570718858.5937.28.camel@lca.pw> <20191010173040.GK18412@dhcp22.suse.cz> <1570729686.5937.30.camel@lca.pw> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1570729686.5937.30.camel@lca.pw> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 10-10-19 13:48:06, Qian Cai wrote: > On Thu, 2019-10-10 at 19:30 +0200, Michal Hocko wrote: > > On Thu 10-10-19 10:47:38, Qian Cai wrote: > > > On Thu, 2019-10-10 at 16:18 +0200, Michal Hocko wrote: > > > > On Thu 10-10-19 09:11:52, Qian Cai wrote: > > > > > On Thu, 2019-10-10 at 12:59 +0200, Michal Hocko wrote: > > > > > > On Thu 10-10-19 05:01:44, Qian Cai wrote: > > > > > > > > > > > > > > > > > > > > > > On Oct 9, 2019, at 12:23 PM, Michal Hocko wrote: > > > > > > > > > > > > > > > > If this was only about the memory offline code then I would agree. But > > > > > > > > we are talking about any printk from the zone->lock context and that is > > > > > > > > a bigger deal. Besides that it is quite natural that the printk code > > > > > > > > should be more universal and allow to be also called from the MM > > > > > > > > contexts as much as possible. If there is any really strong reason this > > > > > > > > is not possible then it should be documented at least. > > > > > > > > > > > > > > Where is the best place to document this? I am thinking about under > > > > > > > the “struct zone” definition’s lock field in mmzone.h. > > > > > > > > > > > > I am not sure TBH and I do not think we have reached the state where > > > > > > this would be the only way forward. > > > > > > > > > > How about I revised the changelog to focus on memory offline rather than making > > > > > a rule that nobody should call printk() with zone->lock held? > > > > > > > > If you are to remove the CONFIG_DEBUG_VM printk then I am all for it. I > > > > am still not convinced that fiddling with dump_page in the isolation > > > > code is justified though. > > > > > > No, dump_page() there has to be fixed together for memory offline to be useful. > > > What's the other options it has here? > > > > I would really prefer to not repeat myself > > http://lkml.kernel.org/r/20191010074049.GD18412@dhcp22.suse.cz > > Care to elaborate what does that mean? I am confused on if you finally agree on > no printk() while held zone->lock or not. You said "If there is absolutely > no way around that then we might have to bite a bullet and consider some > of MM locks a land of no printk." which makes me think you agreed, but your > stance from the last reply seems you were opposite to it. I really do mean that the first step is to remove the dependency from the printk and remove any allocation from the console callbacks. If that turns out to be infeasible then we have to bite the bullet and think of a way to drop all printks from all locks that participate in an atomic allocation requests. -- Michal Hocko SUSE Labs