From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965193AbdCWPaM (ORCPT ); Thu, 23 Mar 2017 11:30:12 -0400 Received: from s3.sipsolutions.net ([5.9.151.49]:42404 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965106AbdCWP3y (ORCPT ); Thu, 23 Mar 2017 11:29:54 -0400 Message-ID: <1490282991.2766.7.camel@sipsolutions.net> Subject: Re: deadlock in synchronize_srcu() in debugfs? From: Johannes Berg To: linux-kernel Cc: Nicolai Stange , "Paul E.McKenney" , gregkh , sharon.dvir@intel.com Date: Thu, 23 Mar 2017 16:29:51 +0100 In-Reply-To: <1490280886.2766.4.camel@sipsolutions.net> References: <1490280886.2766.4.camel@sipsolutions.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.4-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-03-23 at 15:54 +0100, Johannes Berg wrote: > Before I go hunting - has anyone seen a deadlock in > synchronize_srcu() in debugfs_remove() before? Isn't it possible for the following to happen? CPU1 CPU2 mutex_lock(&M); full_proxy_xyz(); srcu_read_lock(&debugfs_srcu); real_fops->xyz(); mutex_lock(&M); debugfs_remove(F); synchronize_srcu(&debugfs_srcu); -> deadlock? I'm not convinced that this is the scenario I'm looking at, since then it seems I should see the mutex_lock(&M) on CPU 2 with a backtrace pointing to a full_proxy and the debugfs operation I recognize, but lots of debugfs files acquire locks and it seems likely that it's not always removed without holding those locks? Am I missing something? I'll see if I can add lockdep annotations. johannes