Received: by 10.223.148.5 with SMTP id 5csp6520738wrq; Wed, 17 Jan 2018 14:55:31 -0800 (PST) X-Google-Smtp-Source: ACJfBouVwNCn2EOhAiq66meEIwRMhZPCwyZfu7mYCXfn6ltJWQjGliWjorCbbP8l912iVzTSQxuA X-Received: by 10.101.69.141 with SMTP id o13mr18082068pgq.204.1516229731308; Wed, 17 Jan 2018 14:55:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516229731; cv=none; d=google.com; s=arc-20160816; b=kUxK8dzhnR/NJKmaR7G9+1oYRJcEJHYjcZdNEdL/PXI8b3QIY3ikKJYgJzsqVsIRWj yU1JgQ+TYiYxt0jGCBYkrq8Kbj6yqkTATQSyDpkrOhHnCDoVbWwEeqRTfdrBiaIkmUVk qA0PqGr2YiutFXCS6P5WUzlhDs4Vmt//kLavmSyRh/PaNY1IzVTBM2ACOjYFHbaiqbKG OQcKSnLfG5Hpebj2KEwdcCMB6PR4Maqx/mlHeCl02wICPG75H6rNVjVFA4IYfytLqt1F AXxyzNY2YCOW6RFB3FkhGvPO/IjLEfSV+UZCk5shiD5c5Q3BaTeim2eaAtXsJEObivQ/ EYMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=+6HqHRuGxbJeAHuVcI1cuS2GT0iizM61AbraUWS/YQI=; b=OHpQ0WltxnijyHEezAdJp5TxGvw4Uw4B9PdARTbAa7aVFg9evd5DjGkLtfDaqn81UX nh95qIZlgyq7hPiqY4Opw3p1SwPfFAUuuwYhQaFnc8YbatynAVQueWagtx5cU1sDwBSC i74ZhsjaJxuLkxC20k75RAeMEts6ZhYjPCvbJBH3gLPM/5L6mfRrUzQf9bBXXJ8vtWCA 306Gg9UAhowsHBEw5REZIAWUkhfGzh+ZpoZY4kfRIizKTLOA47X4phZMEkBhQjhN5t1N epEJqIYe4+p4dJ1mxinhoj7vDuXT71ieZBr0leA0nRILEUMr91hO2yMZDk241e725B5X 6fGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6si5150960pld.270.2018.01.17.14.55.17; Wed, 17 Jan 2018 14:55:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753974AbeAQWyO (ORCPT + 99 others); Wed, 17 Jan 2018 17:54:14 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:47611 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753548AbeAQWyM (ORCPT ); Wed, 17 Jan 2018 17:54:12 -0500 Received: from p4fea5f09.dip0.t-ipconnect.de ([79.234.95.9] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1ebwYS-0003ML-Sg; Wed, 17 Jan 2018 23:51:37 +0100 Date: Wed, 17 Jan 2018 23:54:05 +0100 (CET) From: Thomas Gleixner To: David Miller cc: edumazet@google.com, 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 In-Reply-To: <20180117.172447.1568697383040902713.davem@davemloft.net> Message-ID: References: <20180117.172447.1568697383040902713.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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 17 Jan 2018, David Miller wrote: > 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. commit 3ace873f40916682583562c1e1f324a4a50a2811 in https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git deinlines that function and drops a comment while at it: -/* Post buffer to the network code from _non interrupt_ context. - * see net/core/dev.c for netif_rx description. - */ -static inline int netif_rx_ni(struct sk_buff *skb) It was added somewhere around 2.5.0 Thanks, tglx