Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752715AbbD3Scf (ORCPT ); Thu, 30 Apr 2015 14:32:35 -0400 Received: from smtprelay0111.hostedemail.com ([216.40.44.111]:45340 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752651AbbD3Sca (ORCPT ); Thu, 30 Apr 2015 14:32:30 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2553:2559:2562:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4321:5007:6117:6119:6261:7875:7903:10004:10400:10848:10967:11026:11232:11658:11914:12296:12438:12517:12519:12555:12740:13069:13311:13357:14096:14097:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: frogs86_6cd93377a4b1a X-Filterd-Recvd-Size: 2425 Date: Thu, 30 Apr 2015 14:32:26 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: LKML , linux-rt-users , Thomas Gleixner , Sebastian Andrzej Siewior , Clark Williams , Dave Chinner Subject: Re: [PATCH][RT] xfs: Disable preemption when grabbing all icsb counter locks Message-ID: <20150430143226.061202df@gandalf.local.home> In-Reply-To: <20150430180721.GX5029@twins.programming.kicks-ass.net> References: <20150430123303.30f5bd12@gandalf.local.home> <20150430180721.GX5029@twins.programming.kicks-ass.net> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1526 Lines: 45 On Thu, 30 Apr 2015 20:07:21 +0200 Peter Zijlstra wrote: > On Thu, Apr 30, 2015 at 12:33:03PM -0400, Steven Rostedt wrote: > > diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c > > index 51435dbce9c4..dbaa1ce3f308 100644 > > --- a/fs/xfs/xfs_mount.c > > +++ b/fs/xfs/xfs_mount.c > > @@ -1660,6 +1660,12 @@ xfs_icsb_lock_all_counters( > > xfs_icsb_cnts_t *cntp; > > int i; > > > > + /* > > + * In PREEMPT_RT, preemption is not disabled here, and it > > + * must be to take the xfs_icsb_lock_cntr. > > + */ > > + preempt_disable_rt(); > > + > > for_each_online_cpu(i) { > > cntp = (xfs_icsb_cnts_t *)per_cpu_ptr(mp->m_sb_cnts, i); > > xfs_icsb_lock_cntr(cntp); > > @@ -1677,6 +1683,8 @@ xfs_icsb_unlock_all_counters( > > cntp = (xfs_icsb_cnts_t *)per_cpu_ptr(mp->m_sb_cnts, i); > > xfs_icsb_unlock_cntr(cntp); > > } > > + > > + preempt_enable_rt(); > > } > > The irony, this is distinctly non deterministic code you're putting > under a RT specific preempt_disable ;-) I know :-( Unfortunately, a RT behaving fix would be much more invasive and would probably require the help of the xfs folks. For now, this just prevents a live lock that can happen and halt the system, where it becomes deterministic catastrophe. -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/