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=-0.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 AB32DC33CB1 for ; Thu, 16 Jan 2020 16:27:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6D3FD206D5 for ; Thu, 16 Jan 2020 16:27:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lca.pw header.i=@lca.pw header.b="AOx0F/7R" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D3FD206D5 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 061ED8E007F; Thu, 16 Jan 2020 11:27:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F2DA08E003F; Thu, 16 Jan 2020 11:27:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DF6B58E007F; Thu, 16 Jan 2020 11:27:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0253.hostedemail.com [216.40.44.253]) by kanga.kvack.org (Postfix) with ESMTP id C4FE98E003F for ; Thu, 16 Jan 2020 11:27:32 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 86AFC181AEF07 for ; Thu, 16 Jan 2020 16:27:32 +0000 (UTC) X-FDA: 76384027944.09.root54_79255571cd02 X-HE-Tag: root54_79255571cd02 X-Filterd-Recvd-Size: 5888 Received: from mail-qv1-f65.google.com (mail-qv1-f65.google.com [209.85.219.65]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Thu, 16 Jan 2020 16:27:31 +0000 (UTC) Received: by mail-qv1-f65.google.com with SMTP id u10so9323634qvi.2 for ; Thu, 16 Jan 2020 08:27:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=yyLGxa8xjrcwmAMsji0ieBLF97v4pr3rE1pmt/X/PTg=; b=AOx0F/7R0HgR5MxRITx82a0sB2US6L5QO6ySGD1arnQk6XkmIj+wx+SMO01LNy4sfe rLOTZX8Oq8M1R7jmN/d+YC0K/OsdfJ3E3aiGDUcpzHnwI6Dg1FMrqy4AZgb4ikQDA5Qx y1mviK/3d5+wXPz5OIeNy8IZNUMHL/3fZ7ggHz/jY2W1UXrflv5ddMX6RGW3f5yMfk1a gO22CP8/LlVofpV+Q+BG5O9rfmQOesI8XgxRb4gFZi/gh/fCb6ig58Z6rf56vKkNIuav 9zNnpCxP7ivoZKGytOgWqr/EyNS6851uvLReSyg61IAuNk+bRIfnuShW1uOOr/9SH/+t UwSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=yyLGxa8xjrcwmAMsji0ieBLF97v4pr3rE1pmt/X/PTg=; b=kBUBRsXpftwQUJ29Fch61pyJn+nfH0Xn1c22/WQVQ0B+u6AIgDif8mTtcVz/cuIxfJ KdZ0c04RVKcdVU47pX8sV1oXlj/moBYbAG3tqcr5tXDJ2wpCBIvrywn4zmb2GK4eXIMa SHL+HSSVDl0tR5wfF7VV8mjLCEWG4ibBG2pQXBR3DhYKWVHfILn4cZ0iHpcJ2L2di9sj OkIrSQbYULUNt5HH5hrVF9h9m7WuKhH1QhUZKYlSzkfKNpEoTP7DO3QxMi8dby7d6R28 Z4Ev6aw9JWcdGGUzM4PGqYj/mqfGX2QRmfCNMrVtLfODev4BtxZa5UUlL8N2grMz+oAj Du2Q== X-Gm-Message-State: APjAAAUQQ1qKikaGMsBBA4Nm3i7FfQlZAvDDu0PuiIRcVw2dswRPJ4G4 esnoWKALvxXh7YkOo261EwPMKQ== X-Google-Smtp-Source: APXvYqyltScEnH62Ya/5D9xBkldj2EacHt3SFfmhbmSeXu8rUngvmSm1NO3XxQt5YQ/0EsfCNmy7hA== X-Received: by 2002:a05:6214:1149:: with SMTP id b9mr3328191qvt.227.1579192051307; Thu, 16 Jan 2020 08:27:31 -0800 (PST) Received: from [192.168.1.153] (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id o6sm10122861qkk.53.2020.01.16.08.27.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jan 2020 08:27:30 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Subject: Re: [PATCH -next v3] mm/hotplug: silence a lockdep splat with printk() From: Qian Cai In-Reply-To: <2be969af-53c0-803b-e0b1-eb20d1077dd0@redhat.com> Date: Thu, 16 Jan 2020 11:27:28 -0500 Cc: Michal Hocko , Andrew Morton , Sergey Senozhatsky , pmladek@suse.com, rostedt@goodmis.org, peterz@infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20200115172916.16277-1-cai@lca.pw> <20200116142827.GU19428@dhcp22.suse.cz> <162DFB9F-247F-4DCA-9B69-535B9D714FBB@lca.pw> <20200116155434.GB19428@dhcp22.suse.cz> <2be969af-53c0-803b-e0b1-eb20d1077dd0@redhat.com> To: David Hildenbrand X-Mailer: Apple Mail (2.3608.40.2.2.4) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000021, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > On Jan 16, 2020, at 11:04 AM, David Hildenbrand = wrote: >=20 > On 16.01.20 16:54, Michal Hocko wrote: >> On Thu 16-01-20 09:53:13, Qian Cai wrote: >>>=20 >>>=20 >>>> On Jan 16, 2020, at 9:28 AM, Michal Hocko = wrote: >>>>=20 >>>> On Wed 15-01-20 12:29:16, Qian Cai wrote: >>>>> It is guaranteed to trigger a lockdep splat if calling printk() = with >>>>> zone->lock held because there are many places (tty, console = drivers, >>>>> debugobjects etc) would allocate some memory with another lock >>>>> held which is proved to be difficult to fix them all. >>>>=20 >>>> I am still not happy with the above much. What would say about = something >>>> like below instead? >>>> " >>>> It is not that hard to trigger lockdep splats by calling printk = from >>>> under zone->lock. Most of them are false positives caused by lock = chains >>>> introduced early in the boot process and they do not cause any real >>>> problems. There are some console drivers which do allocate from the >>>> printk context as well and those should be fixed. In any case false >>>> positives are not that trivial to workaround and it is far from = optimal >>>> to lose lockdep functionality for something that is a non-issue. >>>> >>>> " >>>=20 >>> I feel like I repeated myself too many times. A call trace for one = lock dependency >>> is sometimes from early boot process because lockdep will save the = first one it >>> encountered, but it does not mean the lock dependency will only not = happen in >>> early boot. I spent some time to study those early boot call traces = in the given >>> lockdep splats, and it looks to me the lock dependency is also = possible after >>> the boot. >>=20 >> Then state it explicitly with an example of the trace and explanation >> that the deadlock is real. If the deadlock is real then it shouldn't = be >> really terribly hard to notice even without lockdep splats which get >> disabled after the first false positive, right? >=20 > I was asking myself for a long time: did anybody actually see this > deadlock in real life? Nobody knows for sure. I think one reason is that not many people will = use memory offiline even if they do, it will mostly not be a continuous = activity in the system. debugobjects make it way easier to reproduce because it = allocates memory in random places, but then it is not all that popular.=