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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76345C433F5 for ; Mon, 9 May 2022 23:40:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B9E986B0072; Mon, 9 May 2022 19:40:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B4E116B0073; Mon, 9 May 2022 19:40:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9C9466B0074; Mon, 9 May 2022 19:40:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 88EA36B0072 for ; Mon, 9 May 2022 19:40:20 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 5748D30FAA for ; Mon, 9 May 2022 23:40:20 +0000 (UTC) X-FDA: 79447825800.30.6E1FD04 Received: from lgeamrelo11.lge.com (lgeamrelo12.lge.com [156.147.23.52]) by imf12.hostedemail.com (Postfix) with ESMTP id 3B2804008E for ; Mon, 9 May 2022 23:39:56 +0000 (UTC) Received: from unknown (HELO lgeamrelo02.lge.com) (156.147.1.126) by 156.147.23.52 with ESMTP; 10 May 2022 08:40:15 +0900 X-Original-SENDERIP: 156.147.1.126 X-Original-MAILFROM: byungchul.park@lge.com Received: from unknown (HELO X58A-UD3R) (10.177.244.38) by 156.147.1.126 with ESMTP; 10 May 2022 08:40:14 +0900 X-Original-SENDERIP: 10.177.244.38 X-Original-MAILFROM: byungchul.park@lge.com Date: Tue, 10 May 2022 08:38:38 +0900 From: Byungchul Park To: Steven Rostedt Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>, torvalds@linux-foundation.org, damien.lemoal@opensource.wdc.com, linux-ide@vger.kernel.org, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, mingo@redhat.com, linux-kernel@vger.kernel.org, peterz@infradead.org, will@kernel.org, tglx@linutronix.de, joel@joelfernandes.org, sashal@kernel.org, daniel.vetter@ffwll.ch, chris@chris-wilson.co.uk, duyuyang@gmail.com, johannes.berg@intel.com, tj@kernel.org, tytso@mit.edu, willy@infradead.org, david@fromorbit.com, amir73il@gmail.com, gregkh@linuxfoundation.org, kernel-team@lge.com, linux-mm@kvack.org, akpm@linux-foundation.org, mhocko@kernel.org, minchan@kernel.org, hannes@cmpxchg.org, vdavydov.dev@gmail.com, sj@kernel.org, jglisse@redhat.com, dennis@kernel.org, cl@linux.com, penberg@kernel.org, rientjes@google.com, vbabka@suse.cz, ngupta@vflare.org, linux-block@vger.kernel.org, paolo.valente@linaro.org, josef@toxicpanda.com, linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, jack@suse.cz, jack@suse.com, jlayton@kernel.org, dan.j.williams@intel.com, hch@infradead.org, djwong@kernel.org, dri-devel@lists.freedesktop.org, airlied@linux.ie, rodrigosiqueiramelo@gmail.com, melissa.srw@gmail.com, hamohammed.sa@gmail.com Subject: Re: [PATCH RFC v6 00/21] DEPT(Dependency Tracker) Message-ID: <20220509233838.GC6047@X58A-UD3R> References: <1651795895-8641-1-git-send-email-byungchul.park@lge.com> <20220509001637.GA6047@X58A-UD3R> <20220509164712.746e236b@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220509164712.746e236b@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-Rspamd-Queue-Id: 3B2804008E X-Stat-Signature: xqbyhqa5ada8ny9z9y4x1r7qg6weid55 Authentication-Results: imf12.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf12.hostedemail.com: domain of byungchul.park@lge.com designates 156.147.23.52 as permitted sender) smtp.mailfrom=byungchul.park@lge.com X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1652139596-869733 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, May 09, 2022 at 04:47:12PM -0400, Steven Rostedt wrote: > On Mon, 9 May 2022 09:16:37 +0900 > Byungchul Park wrote: > > > CASE 2. > > > > lock L with depth n > > lock A > > lock_nested L' with depth n + 1 > > ... > > unlock L' > > unlock A > > unlock L > > > > This case is allowed by Lockdep. > > This case is *NOT* allowed by DEPT cuz it's a *DEADLOCK*. > > > > --- > > > > The following scenario would explain why CASE 2 is problematic. > > > > THREAD X THREAD Y > > > > lock L with depth n > > lock L' with depth n > > lock A > > lock A > > lock_nested L' with depth n + 1 > > I'm confused by what exactly you are saying is a deadlock above. > > Are you saying that lock A and L' are inversed? If so, lockdep had better Hi Steven, Yes, I was talking about A and L'. > detect that regardless of L. A nested lock associates the the nesting with When I checked Lockdep code, L' with depth n + 1 and L' with depth n have different classes in Lockdep. That's why I said Lockdep cannot detect it. By any chance, has it changed so as to consider this case? Or am I missing something? > the same type of lock. That is, in lockdep nested tells lockdep not to > trigger on the L and L' but it will not ignore that A was taken. It will not ignore A but it would work like this: THREAD X THREAD Y lock Ln lock Ln lock A lock A lock_nested Lm lock_nested Lm So, Lockdep considers this case safe, actually not tho. Byungchul > > -- Steve > > > > > lock_nested L'' with depth n + 1 > > ... ... > > unlock L' unlock L'' > > unlock A unlock A > > unlock L unlock L'