From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752571AbcB2XEV (ORCPT ); Mon, 29 Feb 2016 18:04:21 -0500 Received: from mail-pf0-f182.google.com ([209.85.192.182]:36677 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751682AbcB2XET (ORCPT ); Mon, 29 Feb 2016 18:04:19 -0500 Subject: Re: Softirq priority inversion from "softirq: reduce latencies" To: Thomas Gleixner References: <56D1E8B6.6090003@hurleysoftware.com> <1456638957.3676.12.camel@gmail.com> <20160228170109.GA16322@electric-eye.fr.zoreil.com> <1456721889.3488.67.camel@gmail.com> <56D45DAF.5070709@hurleysoftware.com> <1456759153.648.61.camel@edumazet-ThinkPad-T530> <56D469B2.2070707@hurleysoftware.com> <1456762914.648.76.camel@edumazet-ThinkPad-T530> <56D48869.1000106@hurleysoftware.com> <1456770279.648.85.camel@edumazet-ThinkPad-T530> <56D493A5.403@hurleysoftware.com> Cc: Eric Dumazet , Mike Galbraith , Francois Romieu , Eric Dumazet , David Miller , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Greg KH , dmaengine@vger.kernel.org, John Ogness , Sebastian Andrzej Siewior , Andrew Morton From: Peter Hurley Message-ID: <56D4CE6F.9040702@hurleysoftware.com> Date: Mon, 29 Feb 2016 15:04:15 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/29/2016 11:14 AM, Thomas Gleixner wrote: > On Mon, 29 Feb 2016, Peter Hurley wrote: >> On 02/29/2016 10:24 AM, Eric Dumazet wrote: >>>> Just to be clear >>>> >>>> if (time_before(jiffies, end) && !need_resched() && >>>> --max_restart) >>>> goto restart; >>>> >>>> aborts softirq *even if 0ns have elapsed*, if NET_RX has woken a process. >>> >>> Sure, now remove the 1st and 2nd condition. >> >> Well just removing the 2nd condition has everything working fine, >> because that fixes the priority inversion. > > No. It does not fix anything. It hides the shortcomings of the driver. > >> However, when system resources are _not_ contended, it makes no >> sense to be forced to revert to ksoftirqd resolution, which is strictly >> intended as fallback. > > No. You claim it is simply because your driver does not handle that situation > properly. > >> Or flipping your argument on its head, why not just _always_ execute >> softirq in ksoftirqd? > > Which is what that change effectivley does. And that makes a lot of sense, > because you get the softirq load under scheduler control and do not let the > softirq run as a context stealing entity which is completely uncontrollable by > the scheduler. Ok, fair enough. However, charging [in the scheduler sense] very lightweight DMA completion for one subsystem collectively with very heavyweight NET_RX (doing garbage collection in softirq!) is hardly ideal. The alternative being threaded interrupt handlers (which are essentially treated as 0.000000 scheduler cost). I just want to make sure that's the conscious choice being made, when the patches for converting from tasklet to threaded irq start hitting subsystem maintainers. Regards, Peter Hurley