From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754565AbeAQWYw (ORCPT ); Wed, 17 Jan 2018 17:24:52 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:38156 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753648AbeAQWYu (ORCPT ); Wed, 17 Jan 2018 17:24:50 -0500 Date: Wed, 17 Jan 2018 17:24:47 -0500 (EST) Message-Id: <20180117.172447.1568697383040902713.davem@davemloft.net> To: edumazet@google.com Cc: tglx@linutronix.de, torvalds@linux-foundation.org, efault@gmx.de, peterz@infradead.org, 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 From: David Miller In-Reply-To: References: X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) 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 From: Eric Dumazet Date: Wed, 17 Jan 2018 14:02:43 -0800 > On Wed, Jan 17, 2018 at 2:00 PM, Thomas Gleixner wrote: >> On Wed, 17 Jan 2018, Linus Torvalds wrote: >> >>> On Wed, Jan 17, 2018 at 1:54 PM, Thomas Gleixner wrote: >>> > 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. >>> >>> That does seem unnecessarily expensive, and maybe we could just do it >>> with thread flag (TIF_NOTIFY_RESUME or whatever). >>> >>> In fact, that was what I *thought* we did. Maybe I just remember some >>> historical behavior. >>> >>> Since networking seems to largely prefer softirqd anyway, maybe that >>> wake_softirqd() is the right thing to do anyway. >> >> Well, but we only do it when we are not in a bh disabled region. The places >> where thread context raises the network softirqs is usually inside a bh >> disabled region, so the softirq is executed on local_bh_enable(). The >> thread is woken up rarely. > > There is also the netif_rx_ni() stuff. > > Can't remember right now why it is not using > local_bh_{diable,enable}() pair instead > of preempt_disable() ... if (local_softirq_pending()) do_softirq(); Hmmm, that code predates the initial GIT repository build. I do remember we had some back and forth with that stuff.