From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753844AbeAQVyX (ORCPT ); Wed, 17 Jan 2018 16:54:23 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:47476 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753200AbeAQVyW (ORCPT ); Wed, 17 Jan 2018 16:54:22 -0500 Date: Wed, 17 Jan 2018 22:54:11 +0100 (CET) From: Thomas Gleixner To: David Miller cc: torvalds@linux-foundation.org, efault@gmx.de, peterz@infradead.org, edumazet@google.com, dima@arista.com, frederic@kernel.org, linux-kernel@vger.kernel.org, 0x7f454c46@gmail.com, akpm@linux-foundation.org, fweisbec@gmail.com, hannes@stressinduktion.org, mingo@kernel.org, alexander.levin@verizon.com, pabeni@redhat.com, paulmck@linux.vnet.ibm.com, rrendec@arista.com, riel@redhat.com, sgruszka@redhat.com, wanpeng.li@hotmail.com Subject: Re: [RFC 1/2] softirq: Defer net rx/tx processing to ksoftirqd context In-Reply-To: <20180117.164932.1269304606476934540.davem@davemloft.net> Message-ID: References: <1515782670.7007.3.camel@gmx.de> <20180117.153049.1803664333084879932.davem@davemloft.net> <20180117.164932.1269304606476934540.davem@davemloft.net> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 17 Jan 2018, David Miller wrote: > From: Linus Torvalds > Date: Wed, 17 Jan 2018 13:06:58 -0800 > > > It was in some way always a "poor mans interrupt thread" (with no > > blocking like a real thread context, but at least not impacting actual > > interrupt latency). > > Or in this loopback device case (and tunnel decapsulation) a poor > man's longjmp, releasing the current stack frame to keep the depth > in check. > > Anyways... > > > That said, this made me wonder a bit. I wonder how bounded the latency > > is for raising a softirq from process context. We only _check_ the > > softirq on the last hardirq exit, I think. > > System call return checks it, otherwise this situation would be > completely bolixed. Errm. No. > > > I wonder if we should run softirqs on return to user mode (and make > > softirq set a thread flag if not in interrupt context). > > I'm pretty sure we already do. Nope. raise_softirq() -> raise_softirq_irqoff() set_softirq_bit(); if (!in_interrupt()) wake_softirqd(); So if the caller is not in hard or soft interrupt context, which includes bottom half disabled regions softirqd is woken. If the caller is in a bottom half disabled region then local_bh_enable() will run the pending softirqs. Thanks, tglx