From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDCA4ECE58D for ; Wed, 9 Oct 2019 14:19:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 618D620B7C for ; Wed, 9 Oct 2019 14:19:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=lca.pw header.i=@lca.pw header.b="G0QbIUCI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 618D620B7C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lca.pw Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EF8548E0005; Wed, 9 Oct 2019 10:19:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E81DF8E0003; Wed, 9 Oct 2019 10:19:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D70898E0005; Wed, 9 Oct 2019 10:19:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0207.hostedemail.com [216.40.44.207]) by kanga.kvack.org (Postfix) with ESMTP id A917F8E0003 for ; Wed, 9 Oct 2019 10:19:49 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 16E9F180AD7C3 for ; Wed, 9 Oct 2019 14:19:49 +0000 (UTC) X-FDA: 76024454898.10.cup26_72be47f842f57 X-HE-Tag: cup26_72be47f842f57 X-Filterd-Recvd-Size: 13032 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Wed, 9 Oct 2019 14:19:48 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id n7so3652570qtb.6 for ; Wed, 09 Oct 2019 07:19:48 -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=dFj1u3KIrCIdvk4FcEGdOY8BpCzC8kRESL9rMPXwG1Q=; b=G0QbIUCIb4sGD9a1Qv1+jWTfqGh6stl2V1S5+a8mHuxcAk8xRlphxdZgmGDkWHtZUO i/4MYd6mFCBBOvETLY8n3iOqT1y4EwjD29Q51gj+KRUDMpBs9HjR68P3mEckx3Uks4lT Pea/tHrNFYvS4K1wudFmleqgflW7Rg1rmx7Q+sl0LI0o8r6CnNYi6YDp4R0S86c3HKO1 qVJ6QWVmvRv4m1X4+2pZ++x5TgvUA1S3eXpdTNa9FjynXK1y++qL09DlwGRPngCZgSws zhvqXtJS1tooB7IJ9wIF1jzYu3f9oDkq86S2ND+2g5oH0iBMs2N+rf4Hvo/9eZdI5Wq9 Fwuw== 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=dFj1u3KIrCIdvk4FcEGdOY8BpCzC8kRESL9rMPXwG1Q=; b=tq3NejaZ1Dm8QdARk6qFeM+GIP4ukbBHbWvvE0zkj+yeRrNLbzIhW6ont+/ouYhyAB CUBQVCXE2ta1vY4MSltZnI4yvEPn/NdWNlTUAR7SM2ZdeZJSJHgi3k1JMFhgffvCQ2AW AKkYu8kwElvs1yWrrj19ScxM96bo2r5n5roThFcrLScskisReo6DkFHw19DDz3dpp7mh 9JAcBRmAmhflojhpF+CfYGTf2IACah63f5c0EJe4ojezaNvmoB+tGnoTJhdz0hzrNbCo c0GOG/b6p30ssChtFjm5lxy9DKJMczXE2CHrKj9aNxHCIjLDQ4MmYuDs6/wLqsojIPXk 5hCQ== X-Gm-Message-State: APjAAAWJbmApW/9a6GC1lclQKU8n3Hi91FZNTJfuDAhbGQhs4XGlCkk4 eN9fxLPrDt9Zsq9Ff5SsA2XbRg== X-Google-Smtp-Source: APXvYqwCk2qWG3zWDBDhL+VGWadBtkugM0UqLMXjsol3Z0i+OHscZEnYcywZ24ZaHyAHutqSWHmuOg== X-Received: by 2002:a0c:e982:: with SMTP id z2mr3799888qvn.58.1570630787603; Wed, 09 Oct 2019 07:19:47 -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 v94sm1078574qtd.43.2019.10.09.07.19.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Oct 2019 07:19:46 -0700 (PDT) Message-ID: <1570630784.5937.5.camel@lca.pw> Subject: Re: [PATCH v2] mm/page_isolation: fix a deadlock with printk() From: Qian Cai To: Michal Hocko 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 Date: Wed, 09 Oct 2019 10:19:44 -0400 In-Reply-To: <20191009135155.GC6681@dhcp22.suse.cz> References: <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> <1570626402.5937.1.camel@lca.pw> <20191009132746.GA6681@dhcp22.suse.cz> <1570628593.5937.3.camel@lca.pw> <20191009135155.GC6681@dhcp22.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: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000028, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, 2019-10-09 at 15:51 +0200, Michal Hocko wrote: > On Wed 09-10-19 09:43:13, Qian Cai wrote: > > On Wed, 2019-10-09 at 15:27 +0200, Michal Hocko wrote: > > > On Wed 09-10-19 09:06:42, Qian Cai wrote: > > > [...] > > > > https://lore.kernel.org/linux-mm/1570460350.5576.290.camel@lca.pw= / > > > >=20 > > > > [=C2=A0=C2=A0297.425964] -> #1 (&port_lock_key){-.-.}: > > > > [=C2=A0=C2=A0297.425967]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0__lock_acquire+0x5b3/0xb40 > > > > [=C2=A0=C2=A0297.425967]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0lock_acquire+0x126/0x280 > > > > [=C2=A0=C2=A0297.425968]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0_raw_spin_lock_irqsave+0x3a/0x50 > > > > [=C2=A0=C2=A0297.425969]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0serial8250_console_write+0x3e4/0x450 > > > > [=C2=A0=C2=A0297.425970]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0univ8250_console_write+0x4b/0x60 > > > > [=C2=A0=C2=A0297.425970]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0console_unlock+0x501/0x750 > > > > [=C2=A0=C2=A0297.425971]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0vprintk_emit+0x10d/0x340 > > > > [=C2=A0=C2=A0297.425972]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0vprintk_default+0x1f/0x30 > > > > [=C2=A0=C2=A0297.425972]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0vprintk_func+0x44/0xd4 > > > > [=C2=A0=C2=A0297.425973]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0printk+0x9f/0xc5 > > > > [=C2=A0=C2=A0297.425974]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0register_console+0x39c/0x520 > > > > [=C2=A0=C2=A0297.425975]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0univ8250_console_init+0x23/0x2d > > > > [=C2=A0=C2=A0297.425975]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0console_init+0x338/0x4cd > > > > [=C2=A0=C2=A0297.425976]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0start_kernel+0x534/0x724 > > > > [=C2=A0=C2=A0297.425977]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0x86_64_start_reservations+0x24/0x26 > > > > [=C2=A0=C2=A0297.425977]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0x86_64_start_kernel+0xf4/0xfb > > > > [=C2=A0=C2=A0297.425978]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0secondary_startup_64+0xb6/0xc0 > > > >=20 > > > > where=C2=A0the report again show the early boot call trace for th= e locking > > > > dependency, > > > >=20 > > > > console_owner --> port_lock_key > > > >=20 > > > > but that dependency clearly not only happen in the early boot. > > >=20 > > > Can you provide an example of the runtime dependency without any ea= rly > > > boot artifacts? Because this discussion really doens't make much se= nse > > > without a clear example of a _real_ lockdep report that is not a fa= lse > > > possitive. All of them so far have been concluded to be false possi= tive > > > AFAIU. > >=20 > > An obvious one is in the above link. Just replace the trace in #1 abo= ve with > > printk() from anywhere, i.e., just ignore the early boot calls there = as they are > > not important. > >=20 > > printk() > > console_unlock() > > console_lock_spinning_enable() --> console_owner_lock > > call_console_drivers() > > serial8250_console_write() --> port->lock >=20 > Can you paste the full lock chain graph to be sure we are on the same > page? WARNING: possible circular locking dependency detected 5.3.0-next-20190917 #8 Not tainted ------------------------------------------------------ test.sh/8653 is trying to acquire lock: ffffffff865a4460 (console_owner){-.-.}, at: console_unlock+0x207/0x750 but task is already holding lock: ffff88883fff3c58 (&(&zone->lock)->rlock){-.-.}, at: __offline_isolated_pages+0x179/0x3e0 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&(&zone->lock)->rlock){-.-.}: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0__lock_acquire+0x5b3/0xb40 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0lock_acquire+0x126/0x280 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0_raw_spin_lock+0x2f/0x40 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rmqueue_bulk.constprop.21+0xb6/= 0x1160 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0get_page_from_freelist+0x898/0x= 22c0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0__alloc_pages_nodemask+0x2f3/0x= 1cd0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0alloc_pages_current+0x9c/0x110 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0allocate_slab+0x4c6/0x19c0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0new_slab+0x46/0x70 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0___slab_alloc+0x58b/0x960 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0__slab_alloc+0x43/0x70 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0__kmalloc+0x3ad/0x4b0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0__tty_buffer_request_room+0x100= /0x250 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0tty_insert_flip_string_fixed_fl= ag+0x67/0x110 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0pty_write+0xa2/0xf0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0n_tty_write+0x36b/0x7b0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0tty_write+0x284/0x4c0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0__vfs_write+0x50/0xa0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0vfs_write+0x105/0x290 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0redirected_tty_write+0x6a/0xc0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0do_iter_write+0x248/0x2a0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0vfs_writev+0x106/0x1e0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0do_writev+0xd4/0x180 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0__x64_sys_writev+0x45/0x50 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0do_syscall_64+0xcc/0x76c =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0entry_SYSCALL_64_after_hwframe+= 0x49/0xbe -> #2 (&(&port->lock)->rlock){-.-.}: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0__lock_acquire+0x5b3/0xb40 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0lock_acquire+0x126/0x280 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0_raw_spin_lock_irqsave+0x3a/0x5= 0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0tty_port_tty_get+0x20/0x60 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0tty_port_default_wakeup+0xf/0x3= 0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0tty_port_tty_wakeup+0x39/0x40 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uart_write_wakeup+0x2a/0x40 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0serial8250_tx_chars+0x22e/0x440 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0serial8250_handle_irq.part.8+0x= 14a/0x170 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0serial8250_default_handle_irq+0= x5c/0x90 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0serial8250_interrupt+0xa6/0x130 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0__handle_irq_event_percpu+0x78/= 0x4f0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0handle_irq_event_percpu+0x70/0x= 100 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0handle_irq_event+0x5a/0x8b =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0handle_edge_irq+0x117/0x370 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0do_IRQ+0x9e/0x1e0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ret_from_intr+0x0/0x2a =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0cpuidle_enter_state+0x156/0x8e0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0cpuidle_enter+0x41/0x70 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0call_cpuidle+0x5e/0x90 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0do_idle+0x333/0x370 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0cpu_startup_entry+0x1d/0x1f =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0start_secondary+0x290/0x330 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0secondary_startup_64+0xb6/0xc0 -> #1 (&port_lock_key){-.-.}: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0__lock_acquire+0x5b3/0xb40 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0lock_acquire+0x126/0x280 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0_raw_spin_lock_irqsave+0x3a/0x5= 0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0serial8250_console_write+0x3e4/= 0x450 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0univ8250_console_write+0x4b/0x6= 0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0console_unlock+0x501/0x750 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0vprintk_emit+0x10d/0x340 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0vprintk_default+0x1f/0x30 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0vprintk_func+0x44/0xd4 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0printk+0x9f/0xc5 -> #0 (console_owner){-.-.}: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0check_prev_add+0x107/0xea0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0validate_chain+0x8fc/0x1200 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0__lock_acquire+0x5b3/0xb40 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0lock_acquire+0x126/0x280 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0console_unlock+0x269/0x750 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0vprintk_emit+0x10d/0x340 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0vprintk_default+0x1f/0x30 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0vprintk_func+0x44/0xd4 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0printk+0x9f/0xc5 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0__offline_isolated_pages.cold.5= 2+0x2f/0x30a =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0offline_isolated_pages_cb+0x17/= 0x30 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0walk_system_ram_range+0xda/0x16= 0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0__offline_pages+0x79c/0xa10 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0offline_pages+0x11/0x20 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0memory_subsys_offline+0x7e/0xc0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0device_offline+0xd5/0x110 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0state_store+0xc6/0xe0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0dev_attr_store+0x3f/0x60 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0sysfs_kf_write+0x89/0xb0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0kernfs_fop_write+0x188/0x240 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0__vfs_write+0x50/0xa0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0vfs_write+0x105/0x290 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ksys_write+0xc6/0x160 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0__x64_sys_write+0x43/0x50 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0do_syscall_64+0xcc/0x76c =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0entry_SYSCALL_64_after_hwframe+= 0x49/0xbe other info that might help us debug this: Chain exists of: =C2=A0 console_owner --> &(&port->lock)->rlock --> &(&zone->lock)- >rlock =C2=A0Possible unsafe locking scenario: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0CPU0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0CPU1 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0----=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0---- =C2=A0 lock(&(&zone->lock)->rlock); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0lock(&(&port->lock)->rlock); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0lock(&(&zone->lock)->rlock); =C2=A0 lock(console_owner); =C2=A0*** DEADLOCK *** 9 locks held by test.sh/8653: =C2=A0#0: ffff88839ba7d408 (sb_writers#4){.+.+}, at: vfs_write+0x25f/0x290 =C2=A0#1: ffff888277618880 (&of->mutex){+.+.}, at: kernfs_fop_write+0x128/0x240 =C2=A0#2: ffff8898131fc218 (kn->count#115){.+.+}, at: kernfs_fop_write+0x138/0x240 =C2=A0#3: ffffffff86962a80 (device_hotplug_lock){+.+.}, at: lock_device_hotplug_sysfs+0x16/0x50 =C2=A0#4: ffff8884374f4990 (&dev->mutex){....}, at: device_offline+0x70/0x110 =C2=A0#5: ffffffff86515250 (cpu_hotplug_lock.rw_sem){++++}, at: __offline_pages+0xbf/0xa10 =C2=A0#6: ffffffff867405f0 (mem_hotplug_lock.rw_sem){++++}, at: percpu_down_write+0x87/0x2f0 =C2=A0#7: ffff88883fff3c58 (&(&zone->lock)->rlock){-.-.}, at: __offline_isolated_pages+0x179/0x3e0 =C2=A0#8: ffffffff865a4920 (console_lock){+.+.}, at: vprintk_emit+0x100/0x340 stack backtrace: CPU: 1 PID: 8653 Comm: test.sh Not tainted 5.3.0-next-20190917 #8 Hardware name: HPE ProLiant DL560 Gen10/ProLiant DL560 Gen10, BIOS U34 05/21/2019 Call Trace: =C2=A0dump_stack+0x86/0xca =C2=A0print_circular_bug.cold.31+0x243/0x26e =C2=A0check_noncircular+0x29e/0x2e0 =C2=A0check_prev_add+0x107/0xea0 =C2=A0validate_chain+0x8fc/0x1200 =C2=A0__lock_acquire+0x5b3/0xb40 =C2=A0lock_acquire+0x126/0x280 =C2=A0console_unlock+0x269/0x750 =C2=A0vprintk_emit+0x10d/0x340 =C2=A0vprintk_default+0x1f/0x30 =C2=A0vprintk_func+0x44/0xd4 =C2=A0printk+0x9f/0xc5 =C2=A0__offline_isolated_pages.cold.52+0x2f/0x30a =C2=A0offline_isolated_pages_cb+0x17/0x30 =C2=A0walk_system_ram_range+0xda/0x160 =C2=A0__offline_pages+0x79c/0xa10 =C2=A0offline_pages+0x11/0x20 =C2=A0memory_subsys_offline+0x7e/0xc0 =C2=A0device_offline+0xd5/0x110 =C2=A0state_store+0xc6/0xe0 =C2=A0dev_attr_store+0x3f/0x60 =C2=A0sysfs_kf_write+0x89/0xb0 =C2=A0kernfs_fop_write+0x188/0x240 =C2=A0__vfs_write+0x50/0xa0 =C2=A0vfs_write+0x105/0x290 =C2=A0ksys_write+0xc6/0x160 =C2=A0__x64_sys_write+0x43/0x50 =C2=A0do_syscall_64+0xcc/0x76c =C2=A0entry_SYSCALL_64_after_hwframe+0x49/0xbe