Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753311AbdHWC7N (ORCPT ); Tue, 22 Aug 2017 22:59:13 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:34410 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753194AbdHWC7M (ORCPT ); Tue, 22 Aug 2017 22:59:12 -0400 X-Original-SENDERIP: 156.147.1.126 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Wed, 23 Aug 2017 11:59:09 +0900 From: Byungchul Park To: Sergey Senozhatsky Cc: Bart Van Assche , peterz@infradead.org, "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "martin.petersen@oracle.com" , "axboe@kernel.dk" , "linux-scsi@vger.kernel.org" , "sfr@canb.auug.org.au" , "linux-next@vger.kernel.org" , kernel-team@lge.com Subject: Re: possible circular locking dependency detected [was: linux-next: Tree for Aug 22] Message-ID: <20170823025909.GE3108@X58A-UD3R> References: <20170822183816.7925e0f8@canb.auug.org.au> <20170822104708.GA491@jagdpanzerIV.localdomain> <1503438234.2508.27.camel@wdc.com> <20170823000304.GK20323@X58A-UD3R> <20170823023649.GD10329@jagdpanzerIV.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170823023649.GD10329@jagdpanzerIV.localdomain> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1433 Lines: 46 On Wed, Aug 23, 2017 at 11:36:49AM +0900, Sergey Senozhatsky wrote: > On (08/23/17 09:03), Byungchul Park wrote: > [..] > > aha, ok > > > The report is talking about the following lockup: > > > > A work in a worker A task work on exit to user > > ------------------ --------------------------- > > mutex_lock(&bdev->bd_mutex) > > mutext_lock(&bdev->bd_mutex) > > blk_execute_rq() > > wait_for_completion_io_timeout(&A) > > complete(&A) > > > > Is this impossible? > > I was really confused how this "unlock" may lead to a deadlock Hi Sergey, Right. It should be enhanced. > > > > > other info that might help us debug this: > > > > Possible unsafe locking scenario by crosslock: > > > > CPU0 CPU1 > > > > ---- ---- > > > > lock(&bdev->bd_mutex); > > > > lock((complete)&wait#2); > > > > lock(&bdev->bd_mutex); > > > > unlock((complete)&wait#2); > > > any chance the report can be improved? mention timeout, etc? > // well, if this functionality will stay. > > > p.s. > Bart Van Assche, thanks for Cc-ing Park Byungchul, I was really > sure I didn't enabled the cross-release, but apparently I was wrong: > CONFIG_LOCKDEP_CROSSRELEASE=y > CONFIG_LOCKDEP_COMPLETIONS=y > > -ss