Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751530AbbEDOOq (ORCPT ); Mon, 4 May 2015 10:14:46 -0400 Received: from smtprelay0108.hostedemail.com ([216.40.44.108]:36630 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750918AbbEDOOi (ORCPT ); Mon, 4 May 2015 10:14:38 -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:1981:2194:2198:2199:2200:2393:2553:2559:2562:2691:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4362:5007:6119:6261:7875:7903:8660:9108:10004:10400:10848:10967:11026:11232:11473:11658:11914:12296:12438:12517:12519:12663:12740:13069:13148:13230: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: food10_7f6544b769318 X-Filterd-Recvd-Size: 2831 Date: Mon, 4 May 2015 10:14:33 -0400 From: Steven Rostedt To: Dave Chinner Cc: LKML , linux-rt-users , Thomas Gleixner , Sebastian Andrzej Siewior , Clark Williams , Peter Zijlstra Subject: Re: [PATCH][RT] xfs: Disable preemption when grabbing all icsb counter locks Message-ID: <20150504101433.07f4ae35@gandalf.local.home> In-Reply-To: <20150504004844.GA21261@dastard> References: <20150430123303.30f5bd12@gandalf.local.home> <20150504004844.GA21261@dastard> 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: 1968 Lines: 56 On Mon, 4 May 2015 10:48:44 +1000 Dave Chinner wrote: > > I'm not sure why it does the ndelay() and not just a cpu_relax(), but > > Because the code was writtenlong before cpu_relax() existed, just > like it was written long before the generic percpu counter code was > added... Ah, legacy code. > > .... > > > Now, when PREEMPT_RT is not enabled, that spin_lock() disables > > preemption. But for PREEMPT_RT, it does not. Although with my test box I > > was not able to produce a task state of all tasks, but I'm assuming that > > some task called the xfs_icsb_lock_all_counters() and was preempted by > > an RT task and could not finish, causing all callers of that lock to > > block indefinitely. > > > > Looking at all users of xfs_icsb_lock_all_counters(), they are leaf > > functions and do not call anything that may block on PREEMPT_RT. I > > believe the proper fix here is to simply disable preemption in > > xfs_icsb_lock_all_counters() when PREEMPT_RT is enabled. > > RT is going to have other performance problems that are probably > going to negate the scalability this code provides. If you want a > hack that you can easily backport (as this code now uses the generic > percpu counters) then have a look at fs/xfs/xfs_linux.h: > > /* > * Feature macros (disable/enable) > */ > #ifdef CONFIG_SMP > #define HAVE_PERCPU_SB /* per cpu superblock counters are a 2.6 feature */ > #else > #undef HAVE_PERCPU_SB /* per cpu superblock counters are a 2.6 feature */ > #endif > > You can turn off all that per-cpu code simply by: > > -#ifdef CONFIG_SMP > +#if defined(CONFIG_SMP) && !defined(CONFIG_PREEMPT_RT) Oh, I think I like this the best. Thanks for the advice. -- 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/