From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Rostedt Subject: [PATCH RT 1/2] fs,btrfs: fix rt deadlock on extent_buffer->lock Date: Tue, 17 Mar 2015 15:45:39 -0400 Message-ID: <20150317194604.230381900@goodmis.org> References: <20150317194538.815175744@goodmis.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Cc: Thomas Gleixner , Carsten Emde , Sebastian Andrzej Siewior , John Kacur , Paul Gortmaker , Clark Williams , Chris Mason , Mike Galbraith To: linux-kernel@vger.kernel.org, linux-rt-users Return-path: Content-Disposition: inline; filename=0025-fs-btrfs-fix-rt-deadlock-on-extent_buffer-lock.patch Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-rt-users.vger.kernel.org 3.2.68-rt99-rc2 stable review patch. If anyone has any objections, please let me know. ------------------ From: Mike Galbraith Sat Jul 14 12:30:41 CEST 2012 Trivially repeatable deadlock is cured by enabling lockdep code in btrfs_clear_path_blocking() as suggested by Chris Mason. He also suggested restricting blocking reader count to one, and not allowing a spinning reader while blocking reader exists. This has proven to be unnecessary, the strict lock order enforcement is enough.. or rather that's my box's opinion after long hours of hard pounding. Note: extent-tree.c bit is additional recommendation from Chris Mason, split into a separate patch after discussion. Link: http://lkml.kernel.org/r/1414913478.5380.114.camel@marge.simpson.net Cc: linux-rt-users Cc: Thomas Gleixner Cc: Carsten Emde Cc: John Kacur Cc: Sebastian Andrzej Siewior Cc: Clark Williams Cc: Chris Mason Signed-off-by: Mike Galbraith Signed-off-by: Steven Rostedt Conflicts: fs/btrfs/extent-tree.c --- fs/btrfs/ctree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index dede441bdeee..980adc0ecc3a 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -77,7 +77,7 @@ noinline void btrfs_clear_path_blocking(struct btrfs_path *p, { int i; -#ifdef CONFIG_DEBUG_LOCK_ALLOC +#if (defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_PREEMPT_RT_BASE)) /* lockdep really cares that we take all of these spinlocks * in the right order. If any of the locks in the path are not * currently blocking, it is going to complain. So, make really @@ -104,7 +104,7 @@ noinline void btrfs_clear_path_blocking(struct btrfs_path *p, } } -#ifdef CONFIG_DEBUG_LOCK_ALLOC +#if (defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_PREEMPT_RT_BASE)) if (held) btrfs_clear_lock_blocking_rw(held, held_rw); #endif -- 2.1.4