Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2019015ybp; Thu, 10 Oct 2019 00:41:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7dzGjUK8hFrI5WRlDo40I47hp0Q55wk4AedwHTMyOiAnV/jHKVTf0bGEzVjWapoljvAYx X-Received: by 2002:a50:f296:: with SMTP id f22mr6835944edm.69.1570693318513; Thu, 10 Oct 2019 00:41:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570693318; cv=none; d=google.com; s=arc-20160816; b=dystdTgpW1gQl7LuglQxRMiQT7jIazqLaxX4UcDPZSC0piu78s84FoKjErqCRUE9EM PJllj7BXogyHaDv5SOUaISNONJYqifhSb2TRedGcZJM6aVmHD+8XkJcgqYD7+BwQHa17 psllnkfRjLo7/WEjXqiabw2jmszcTu0fA5OGE3NKzCVuYvq2Oz2EAFoRT15bnt6pToIw XuLZVpwERfpIAl7lwJievmBlzGHhYuzMAQKk+5Liih3hBj1X5sZOtL0sLvEO79LXSMNp g8VKLAYhct9sVtsy/Rr6Rv5oONcB+5QBRqXcBjlqGKbXt2+Ble4oigizqit/GuaUs95/ w/Mg== 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=RUbKip4pEdmSqWo8dsgZEnNrO+R7JgxW+ctkmG9FGSI=; b=r7sPfNi6zhaa95u+9yx0gSTj5kpLiXD+A9quYCgUI9pLZkaHtB9SprYYshsbGODpbF 6x8mb1oF5IQ0eqLJHwa97fRx0v3XeTMU3YezTdZQbFPa4ZuGjVOrMPq1CcyUuPZfOQZj jfjxaba7MuGW9iEZEcGdhEacDWPE6tKJB14IM4nSMsJ5VZ7mkSRM/t99GMy49gTYhGdg /bX+dmpM6sTnHDkK1lOU9EBLcob0OHKnDgAt0bTjkGgjP8Yt+u4NyR51jxTUxI2jyGfL lzYp528C6zGXCv4DmIc1TCurx2XJJHgT/YaRGrA+VXgaWzIaHJn1GnKAFnRbbqiwvsyR gQRw== 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 f13si3034644edl.170.2019.10.10.00.41.34; Thu, 10 Oct 2019 00:41:58 -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 S2387507AbfJJHkw (ORCPT + 99 others); Thu, 10 Oct 2019 03:40:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:51922 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733088AbfJJHkw (ORCPT ); Thu, 10 Oct 2019 03:40:52 -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 7AC7FAF61; Thu, 10 Oct 2019 07:40:50 +0000 (UTC) Date: Thu, 10 Oct 2019 09:40:49 +0200 From: Michal Hocko To: Sergey Senozhatsky Cc: Peter Oberparleiter , Qian Cai , Christian Borntraeger , Petr Mladek , akpm@linux-foundation.org, rostedt@goodmis.org, peterz@infradead.org, linux-mm@kvack.org, john.ogness@linutronix.de, david@redhat.com, linux-kernel@vger.kernel.org, Heiko Carstens , Vasily Gorbik Subject: Re: [PATCH v2] mm/page_isolation: fix a deadlock with printk() Message-ID: <20191010074049.GD18412@dhcp22.suse.cz> References: <1570228005-24979-1-git-send-email-cai@lca.pw> <20191007143002.l37bt2lzqtnqjqxu@pathway.suse.cz> <20191007144937.GO2381@dhcp22.suse.cz> <20191008074357.f33f6pbs4cw5majk@pathway.suse.cz> <20191008082752.GB6681@dhcp22.suse.cz> <1570550917.5576.303.camel@lca.pw> <1157b3ae-006e-5b8e-71f0-883918992ecc@linux.ibm.com> <20191009142623.GE6681@dhcp22.suse.cz> <20191010051201.GA78180@jagdpanzerIV> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191010051201.GA78180@jagdpanzerIV> 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 14:12:01, Sergey Senozhatsky wrote: > On (10/09/19 16:26), Michal Hocko wrote: > > On Wed 09-10-19 15:56:32, Peter Oberparleiter wrote: > > [...] > > > A generic solution would be preferable from my point of view though, > > > because otherwise each console driver owner would need to ensure that any > > > lock taken in their console.write implementation is never held while > > > memory is allocated/released. > > > > Considering that console.write is called from essentially arbitrary code > > path IIUC then all the locks used in this path should be pretty much > > tail locks or console internal ones without external dependencies. > > That's a good expectation, but I guess it's not always the case. > > One example might be NET console - net subsystem locks, net device > drivers locks, maybe even some MM locks (skb allocations?). I am not familiar with the netconsole code TBH. 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. I have already said that in this thread. I am mostly pushing back on "let's just go the simplest way" approach. > But even more "commonly used" consoles sometimes break that > expectation. E.g. 8250 > > serial8250_console_write() > serial8250_modem_status() > wake_up_interruptible() By that expectation you mean they are using external locks or that they really _need_ to allocate. Because if you are pointing to wake_up_interruptible and therefore the rq then this is a well known thing and I was under impression even documented but I can only see LOGLEVEL_SCHED that is arguably a very obscure way to document the fact. -- Michal Hocko SUSE Labs