From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753679AbeAQWAp (ORCPT ); Wed, 17 Jan 2018 17:00:45 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:47512 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753075AbeAQWAo (ORCPT ); Wed, 17 Jan 2018 17:00:44 -0500 Date: Wed, 17 Jan 2018 23:00:37 +0100 (CET) From: Thomas Gleixner To: Linus Torvalds cc: David Miller , Mike Galbraith , Peter Zijlstra , Eric Dumazet , Dmitry Safonov , Frederic Weisbecker , Linux Kernel Mailing List , Dmitry Safonov <0x7f454c46@gmail.com>, Andrew Morton , Frederic Weisbecker , Hannes Frederic Sowa , Ingo Molnar , Sasha Levin , Paolo Abeni , Paul McKenney , Radu Rendec , Rik van Riel , Stanislaw Gruszka , Wanpeng Li Subject: Re: [RFC 1/2] softirq: Defer net rx/tx processing to ksoftirqd context In-Reply-To: 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, 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. Thanks, tglx