From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751030AbdLGIxc (ORCPT ); Thu, 7 Dec 2017 03:53:32 -0500 Received: from smtprelay0166.hostedemail.com ([216.40.44.166]:32810 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750781AbdLGIxa (ORCPT ); Thu, 7 Dec 2017 03:53:30 -0500 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:2196:2199:2200:2393:2553:2559:2562:2693:2737:2904:2911:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4425:5007:6261:7875:9040:10004:10400:10848:10967:11026:11232:11658:11914:12109:12663:12740:12760:12895:13069:13161:13229:13311:13357:13439:14096:14097:14181:14659:14721:21080:21433:21627:30054:30064:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: month90_7581fc4ac5312 X-Filterd-Recvd-Size: 2625 Date: Thu, 7 Dec 2017 03:52:24 -0500 From: Steven Rostedt To: "Su, David W" Cc: "linux-kernel@vger.kernel.org" , "bigeasy@linutronix.de" , "tglx@linutronix.de" Subject: Re: [PATCH RT] vfio-pci: Set MSI/MSI-X ISR to non-threaded Message-ID: <20171207032939.4d9b150d@vmware.local.home> In-Reply-To: <3875C02542CA2945BF761013C1F5B8E57F4CE86A@ORSMSX109.amr.corp.intel.com> References: <1512090335-6888-1-git-send-email-david.w.su@intel.com> <20171130210857.53b81ba3@gandalf.local.home> <3875C02542CA2945BF761013C1F5B8E57F4CE86A@ORSMSX109.amr.corp.intel.com> X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.31; 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 On Thu, 7 Dec 2017 01:27:03 +0000 "Su, David W" wrote: > >And spin_lock() turns into a mutex in PREEMPT_RT, which means it can > >sleep. You can't sleep in hard interrupt context. This will eventually > >crash the kernel. > > Steve, thanks for your review and comment. > > I can think of 2 scenarios where there is contention for the eventfd > context lock. > > One scenario is an eventfd is used to notify a VFIO application of > 2 or more IRQs. But in this case the application wouldn't be able to > tell which IRQ occurred and so I think it should be considered a > programming error of the application and not a proper usage of > VFIO. Remember, if there is contention, the system will CRASH! Boom, panic, end of story. Are you blowing this off to just a programming error of the application? I'm sure lots of root kit developers are excited about this. > > The other is a device IRQ is configured to be delivered to multiple > CPU cores at the same time. However, I have never seen such a > device and cannot think of any good reason for a device to be > designed this way. > > So, IMHO it is safe to set vfio-pci ISR to non-threaded. Please tell me that you are not arguing that it's OK to have a sleeping mutex in a hard threaded IRQ handler because "proper programming will prevent contention". If that is truly your argument, then I'm done here, with a perpetual NACK on your patches. -- Steve > > > > >And no, we are not going to convert the ctx->wqh.lock into a > >raw_spin_lock. > >