Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4420790ybp; Mon, 7 Oct 2019 08:13:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqz13gwzmEnLVfRL/ssvaoPWD6yYKXnueCGyNJ1XYHRF4pH0rsr+1O00X3llroVsaLySv82m X-Received: by 2002:a17:906:57ce:: with SMTP id u14mr24752406ejr.184.1570461204382; Mon, 07 Oct 2019 08:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570461204; cv=none; d=google.com; s=arc-20160816; b=QhgSq4Lxyn0GF0GgkOTdHelyvhLdpNIonGESAHeLq/uRqgJmaVEeYAXD3p3MssNwKJ Yrc2deXN5AAcj18A1/x2ou8JuSXxqDtkUwPf4LzLkyvQ1VQeD2LArarZM7v4YZ/inYYx iCsi0+hqe4LicM+yeLdg2Y9rLxVKYM+UVVFDSdrW6P0wYFWWwyM48686HdSqQ5/KrVFj s4H865rIaVmXkl4bZFSTELRa3sPtkrhHgx/pfB8vv/1SU/4wOMC711g5bcEj9/dJfVLz 283Ijv52B33ScggKjdkRkTBq0oUTyawm0O6w0egut0lva3yJDHQQqP43uTKhdGt1D6rv q3Bw== 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=nijogHKobOzFXgKz+LWl0rAsug/RMhYKwx59WhY8bzA=; b=y4iK+IpzEX1ERx10by7RvDej79ylLALg415CYwcfJoeWd3IaFXoMNNr+eu8s8Nh3bT JqtUXNsT+1h5OBMkhvxUemYYaf2Ys3FR6y+/CE75esGd24dhn5D6+aIsNpxqs0/f+Ist PsV9cUl51qE8DhxABZ6Tk75LNxHMoSxtPhdWYuXiOlS16MImP1xL9be1ndBDJcudQleE pJyWCqrVq0uqyPAxNzVZ/oZ5w8TtBWQfWgQ0tbCNJr+lsXbvc4+y+wXWQkrli6DniHtO BvrcXb79YInHAaAD2dpVlUfsxAPxYy75daSqgo2X9r0hXvRuWEu7A/XLES2kWgJP+yCz L+Qw== 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 v3si8809891edc.404.2019.10.07.08.12.58; Mon, 07 Oct 2019 08:13:24 -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 S1728821AbfJGPMo (ORCPT + 99 others); Mon, 7 Oct 2019 11:12:44 -0400 Received: from mx2.suse.de ([195.135.220.15]:42570 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727835AbfJGPMk (ORCPT ); Mon, 7 Oct 2019 11:12:40 -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 38C55AC26; Mon, 7 Oct 2019 15:12:38 +0000 (UTC) Date: Mon, 7 Oct 2019 17:12:37 +0200 From: Michal Hocko To: Qian Cai Cc: Petr Mladek , akpm@linux-foundation.org, sergey.senozhatsky.work@gmail.com, rostedt@goodmis.org, peterz@infradead.org, linux-mm@kvack.org, john.ogness@linutronix.de, david@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm/page_isolation: fix a deadlock with printk() Message-ID: <20191007151237.GP2381@dhcp22.suse.cz> References: <1570228005-24979-1-git-send-email-cai@lca.pw> <20191007143002.l37bt2lzqtnqjqxu@pathway.suse.cz> <1570460350.5576.290.camel@lca.pw> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1570460350.5576.290.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 Mon 07-10-19 10:59:10, Qian Cai wrote: [...] > It is almost impossible to eliminate all the indirect call chains from > console_sem/console_owner_lock to zone->lock because it is too normal that > something later needs to allocate some memory dynamically, so as long as it > directly call printk() with zone->lock held, it will be in trouble. Do you have any example where the console driver really _has_ to allocate. Because I have hard time to believe this is going to work at all as the atomic context doesn't allow to do any memory reclaim and such an allocation would be too easy to fail so the allocation cannot really rely on it. So again, crippling the MM code just because of lockdep false possitives or a broken console driver sounds like a wrong way to approach the problem. > [??297.425964] -> #1 (&port_lock_key){-.-.}: > [??297.425967]????????__lock_acquire+0x5b3/0xb40 > [??297.425967]????????lock_acquire+0x126/0x280 > [??297.425968]????????_raw_spin_lock_irqsave+0x3a/0x50 > [??297.425969]????????serial8250_console_write+0x3e4/0x450 > [??297.425970]????????univ8250_console_write+0x4b/0x60 > [??297.425970]????????console_unlock+0x501/0x750 > [??297.425971]????????vprintk_emit+0x10d/0x340 > [??297.425972]????????vprintk_default+0x1f/0x30 > [??297.425972]????????vprintk_func+0x44/0xd4 > [??297.425973]????????printk+0x9f/0xc5 > [??297.425974]????????register_console+0x39c/0x520 > [??297.425975]????????univ8250_console_init+0x23/0x2d > [??297.425975]????????console_init+0x338/0x4cd > [??297.425976]????????start_kernel+0x534/0x724 > [??297.425977]????????x86_64_start_reservations+0x24/0x26 > [??297.425977]????????x86_64_start_kernel+0xf4/0xfb > [??297.425978]????????secondary_startup_64+0xb6/0xc0 This is an early init code again so the lockdep sounds like a false possitive to me. -- Michal Hocko SUSE Labs