Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2072372ybp; Thu, 10 Oct 2019 01:40:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzAmLWyJxgN04jUUxf5TcBa3E9IjZOrFgkEr9hP4oPvSz1V/1J8e29qNfZ5vOt/5k3LY+d1 X-Received: by 2002:aa7:cfcd:: with SMTP id r13mr7117190edy.146.1570696840883; Thu, 10 Oct 2019 01:40:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570696840; cv=none; d=google.com; s=arc-20160816; b=C7xbNQyS5zRFzM+ekanyPHjqvmQJvLMbM21UUyHSUxS2AS4kew3gQh2oypElHRm6AJ sz1r4XUw5LCc5e2r65pLd2rpnc428KnsGUJxwJDaGD1GTovyeWxbedqKAMEKrXp4msUZ Ng4hn892Wi20Pe4gXwT6Ou4YEjgxEXBmprXf3iJCK0BkEBMyk94EBji9kH2+3sqmhZ7/ tqx1TDRhUC7i+45Z3HNCEQEjNAGfG4gDSU0y9VLPKT5+K0nkFQ9PvBW07Yl8w1YW/AcT UBhaUvywzYSVOxXG8C/lxhSG22/GIuxQVIG32w+zR5qCeFVzblER6HUlFm9r4Zpytmc4 cMyA== 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:dkim-signature; bh=RGh2rO2aZYwHa/Y1Cj8hBGbPD5Mu0Wu+i6Qq6LV4LEI=; b=g21xZfJwFxVtL0ppiRCwxVIyRtI7i+9XukrM3pELol2DwBZDhqGDCaX0tU2A7M+WQ1 Lsz8ir+Uv/DY5nlTnYwzh9QV65kjzEeg6jOgqj8PgK0zwB68cQ4w2alwDU/IB/w3SzoZ javp3yBSLvvlIMhp7ZWy3QIlWmDyAZi7FLFRh4t4z/jv59stYf0EvcdAOExHRPpCOavK WbWlQa+qDKZjbwltWRz3MWaUcrZmTHTAAzBGh7Pjy4GsSNFlsltzcYfe9Ehc4A96Iu6r sTo7edLiatIOCwpF3kV+oMStx45TM2F8/O/Sw71wK6lULr6q9VfTrRCYPF+18NCcs0/T Ew4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aHI15Eqn; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l15si2795848eja.290.2019.10.10.01.40.17; Thu, 10 Oct 2019 01:40:40 -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=@gmail.com header.s=20161025 header.b=aHI15Eqn; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387827AbfJJIjR (ORCPT + 99 others); Thu, 10 Oct 2019 04:39:17 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:44314 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387811AbfJJIjQ (ORCPT ); Thu, 10 Oct 2019 04:39:16 -0400 Received: by mail-pg1-f195.google.com with SMTP id u12so3192397pgb.11 for ; Thu, 10 Oct 2019 01:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=RGh2rO2aZYwHa/Y1Cj8hBGbPD5Mu0Wu+i6Qq6LV4LEI=; b=aHI15Eqn17jVYTeOisUaG2auUiaQ9Nh+Y7ptTdWinJ1D3CXNzQAzCh2dgAqnt61w3B shS9tNsgTFeFis0h9W2AJaZ8WOu5myce8cgqJjQFZGe81ASkeqMBzHZXVL6TM0XrIo3s 7JaIPCbTICFYmy2d71zVsvFX5yjP5z/rBsgpzVV0K8c63MQCbpRIPzeyVBlSRny44Y2A XFs54k1CecH15wp7YrNupz+s8oA62/OlvvQ1AzWs/biKAYX5ggWeQCQwo1JaxNu+uKbT qzS6QPNOblP/TLgoj/yOmZyh6jqeV/ysNpy6UhH7VO4CxKr6rn4bKkUpndITvBBs9/R3 gmCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=RGh2rO2aZYwHa/Y1Cj8hBGbPD5Mu0Wu+i6Qq6LV4LEI=; b=JEFMD157Wg5ZqCvgWVaSOc0bbB6EfSRxnckkkqALfMrXfKG8+cVYW5iNKsDUcQ8ta6 +nSWxxnMyExticl2IGVVtpFFUQW0yfmusHVu9jP4P9drirlzYk7V0tfKGLeLqpTevDFd Z21MkZKkvuTthx2F+JRKqBexlV931hLhJJS30bNJ7oEvrwMueuy13Szxfv4gfoq2NLOo j4xDy6ifesLoMhJNdJGj/GjiTRiH51Y54LnKXrwQPxTdSrM7l1C1PrSh+jqEQsxVl5t+ w6n7wsZNS4NujPdWRE7QyfYuhAYJ0EtCNNs0++Sn/1tXZ1PEvc+ecvqwh7F9SdqRWMpS ZYtQ== X-Gm-Message-State: APjAAAVRazs2VMmrOoITAVhNaiktqjiRtwpUWn/mGVCQjpCzahoS9UuH Rmjhyp6bQTZzKBS6ndWSyZA= X-Received: by 2002:a65:66c3:: with SMTP id c3mr7121338pgw.448.1570696755438; Thu, 10 Oct 2019 01:39:15 -0700 (PDT) Received: from localhost ([2001:e60:1023:519f:3055:27ff:fe5a:5b5c]) by smtp.gmail.com with ESMTPSA id h4sm5010117pfg.159.2019.10.10.01.39.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 01:39:14 -0700 (PDT) Date: Thu, 10 Oct 2019 17:39:08 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Sergey Senozhatsky , Michal Hocko , Christian Borntraeger , Heiko Carstens , rostedt@goodmis.org, peterz@infradead.org, linux-mm@kvack.org, Qian Cai , 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: <20191010083908.GA2521@jagdpanzerIV> References: <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> <20191010082110.dreavjarni7mkvv6@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191010082110.dreavjarni7mkvv6@pathway.suse.cz> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (10/10/19 10:21), Petr Mladek wrote: [..] > > > 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?). > > > > But even more "commonly used" consoles sometimes break that > > expectation. E.g. 8250 > > > > serial8250_console_write() > > serial8250_modem_status() > > wake_up_interruptible() > > > > And so on. > > I think that the only maintainable solution is to call the console > drivers in a well defined context (kthread). We have finally opened > doors to do this change. Yeah, that's a pretty complex thing, I suspect. Panic flush to netcon may deadlock if oops occurs under one of those "important MM locks" (if any MM locks are actually involved in ATOMIC skb allocation). If there are such MM locks, then I think flush_on_panic issue can't be address by printing kthread or ->atomic_write callback. > Using printk_deferred() or removing the problematic printk() is > a short term workaround. I am not going to block such patches. > But the final decision will be on maintainers of the affected subsystems. Agreed. -ss