Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp904840ybp; Wed, 9 Oct 2019 06:07:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNT/VkhailsuGHQ95dM3PMhln+UrS2Dmc0FEBKiYy4xjpj5WNSV/aNKkkk5k8KWfU/pwlD X-Received: by 2002:a17:906:f181:: with SMTP id gs1mr291242ejb.13.1570626445955; Wed, 09 Oct 2019 06:07:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570626445; cv=none; d=google.com; s=arc-20160816; b=WDYxjzv+SzOh1jLixP6hiEuRT0S4cGknuzAhb5PugxNlW/QTg3vzZZU+oAYWqkxtTP Nm4Kahtai3msUARLzyDTpGlR1I2hcliiom/6udoYCm7IQfFNfZ0WyaxGSXAmgLW9VzEz GnN+buri4phX0wA7oi3aUxbnOlGT/lQe+OVCSqWouBB0HCiAXIT58y56tpXiV+Av1QD6 ShXY8wB3bp8CDLVg7VluEKWRbWtPobLLI34UsytD+wWeUlT11sd/W9saO6+Gv/aLhQZQ zeVjwIdybIM2301sQKCRQbTrbaO+f+7k9FddFH5Vk9U+JksORDFYibljS0Df0U40mQUi HFHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=Jqe/coE5F1tFeFAB+cBZL0Rw3251E35i3lRoHeRm+YY=; b=Fe7TDIusA0oar4fJX8cG56mLn3H9rq1khBdTFdXCNAG7C+4XvkyRpC3Bqgf8Ko2ab5 d9P0GWAnfM19+Tg7WuyZJSdWu5UtRdBi1bG/AsDJC5aZqDK72FhO6pMnke1I5++MSFTp k5dyOSBO9O2+8G62fO4hseZnYcVYZs9KMVq6TLoXoDL/uxDev23KT4azMWAoSlzcb0P3 5zTiudM+0nm+b2uIL5YsjMJ9If0XoDvvQD1rTpQ8hVvFrBPCDh/DbCpF1Hq0sH4u1FWb 5a5k1RucPSSQJp6Er2bSb5/wFH2/+IGiKJ+2m7lfXsr1OObe2UBZ3wsghTgKGq/aRjIA RbPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=D+YHUacq; 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 e12si1313977edb.262.2019.10.09.06.07.00; Wed, 09 Oct 2019 06:07:25 -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=@lca.pw header.s=google header.b=D+YHUacq; 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 S1731240AbfJINGr (ORCPT + 99 others); Wed, 9 Oct 2019 09:06:47 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:34214 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730858AbfJINGr (ORCPT ); Wed, 9 Oct 2019 09:06:47 -0400 Received: by mail-qt1-f195.google.com with SMTP id 3so3331125qta.1 for ; Wed, 09 Oct 2019 06:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=Jqe/coE5F1tFeFAB+cBZL0Rw3251E35i3lRoHeRm+YY=; b=D+YHUacqyIDaP+HxhuqrHJTtHXqUHgfWPKFPD/755jbIsX4oMxZdkNf2QSgZknuE4B IQHND/Iqc2+ok8R8obzFhitheYoydOy8Jxbqa5itMCOTR16bfdQ+YDpP5dPRDenWFGTO UlcRgKnKua15NqhnF40nP7a85WjGopV1yCnfWlQMgb9/PB7FTTW2/vP/3Ef1vLj0nYbU /lnrKHZOb/K+0ucPueJ+6L4dRUs0Ev/9Z3n+Cmbxov/l4IQT+ay/l5BWeATPgU8nzlt6 yRk5UfCdDhUIN7QMiyXMCY1LpsDSTJkW+Y0SGPFbMAZV6hW3ooiXCnGSJB4pxbxF4lDh Fd2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=Jqe/coE5F1tFeFAB+cBZL0Rw3251E35i3lRoHeRm+YY=; b=kxTKZyzqoja4EphjrAHktxxlWDtiFdtR7Tje3PZcJis4U3whTGfDbikzhMel4WK3jR tTKJGBpKRehWr1aSxfvwI8S3ZJsmjmh1QBxorpE+c/m5RhKBhDm2u1ffv4pm1/PpEA/3 zCOJxcqnoDtdHNSqRvllqKrInFRbU93KFxxZQqQV/r8CNAqbPkTh1Axhtea4pgyjWdy0 WxNLoe0R9rqehJ9Wvq3MX1Djf4x2M9SMvOiLkmjrr4ExlYdkM/jj7cIY607nUnPoPFjU hCIbattbCVo3VSN8TPD0Fp638bMMNo6k3VCfhpcJFT7zSEOCdOH3aOYsh5H90yPTbobs FREQ== X-Gm-Message-State: APjAAAWc9E/l8gpLd9xOTa+DIdiJAOHj3cG7lrzBn8Moi1qVksam6m0I uNSzVlnBSB0xkGPc4ll2J4QUwg== X-Received: by 2002:ac8:3462:: with SMTP id v31mr3260844qtb.330.1570626404804; Wed, 09 Oct 2019 06:06:44 -0700 (PDT) Received: from dhcp-41-57.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id z5sm896980qkl.101.2019.10.09.06.06.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Oct 2019 06:06:43 -0700 (PDT) Message-ID: <1570626402.5937.1.camel@lca.pw> Subject: Re: [PATCH v2] mm/page_isolation: fix a deadlock with printk() From: Qian Cai To: Petr Mladek Cc: Michal Hocko , 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 Date: Wed, 09 Oct 2019 09:06:42 -0400 In-Reply-To: <20191009114903.aa6j6sa56z2cssom@pathway.suse.cz> 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> <20191008183525.GQ6681@dhcp22.suse.cz> <1570561573.5576.307.camel@lca.pw> <20191008191728.GS6681@dhcp22.suse.cz> <1570563324.5576.309.camel@lca.pw> <20191009114903.aa6j6sa56z2cssom@pathway.suse.cz> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 (3.22.6-10.el7) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-10-09 at 13:49 +0200, Petr Mladek wrote: > On Tue 2019-10-08 15:35:24, Qian Cai wrote: > > On Tue, 2019-10-08 at 21:17 +0200, Michal Hocko wrote: > > > On Tue 08-10-19 15:06:13, Qian Cai wrote: > > > > On Tue, 2019-10-08 at 20:35 +0200, Michal Hocko wrote: > > > > > > [...] > > > > > I fully agree that this class of lockdep splats are annoying especially > > > > > when they make the lockdep unusable but please discuss this with lockdep > > > > > maintainers and try to find some solution rather than go and try to > > > > > workaround the problem all over the place. If there are places that > > > > > would result in a cleaner code then go for it but please do not make the > > > > > code worse just because of a non existent problem flagged by a false > > > > > positive. > > > > > > > > It makes me wonder what make you think it is a false positive for sure. > > > > > > Because this is an early init code? Because if it were a real deadlock > > > > No, that alone does not prove it is a false positive. There are many places > > could generate that lock dependency but lockdep will always save the earliest > > one. > > You are still mixing the pasted lockdep report and other situations > that will not get reported because of the first one. The lockdep report is designed to only just give a clue on the existing locking dependency. Then, it is normal that developers need to audit all places of that particular locking dependency to confirm it is a true false positive. > > We believe that the pasted report is pasted is false positive. And we > are against complicating the code just to avoid this false positive. This is totally incorrect as above and there is even another similar example of the splat during memory offline I mentioned earlier, https://lore.kernel.org/linux-mm/1570460350.5576.290.camel@lca.pw/ [  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 where the report again show the early boot call trace for the locking dependency, console_owner --> port_lock_key but that dependency clearly not only happen in the early boot. I agree with you that it is hard to hit because it needs 4 CPUs to hit the exact the same spot. > > Are you sure that the workaround will not create real deadlocks > or races? > > I see two realistic possibilities: > > + Make printk() always deferred. This will hopefully happen soon. > > + Improve lockdep so that false positives could get ignored > without complicating the code. There are certainly rooms to improve the lockdep but it does not help in this case as mentioned above.