Received: by 10.223.148.5 with SMTP id 5csp6453652wrq; Wed, 17 Jan 2018 14:04:04 -0800 (PST) X-Google-Smtp-Source: ACJfBov3/tJEfHkqy/VUXc9IxpA/9/q5LJcnLNhzodHXX36aBcvge9kQssWKAL/89y6yCrcMRP3Z X-Received: by 10.159.198.145 with SMTP id g17mr12916619plo.446.1516226644762; Wed, 17 Jan 2018 14:04:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516226644; cv=none; d=google.com; s=arc-20160816; b=v/W3AFfplbOaW9I7Occg0KIQf9wKhjG9gPsuRTK6qi2xAEIIPzOnxCM7V9POkGrlwF mDImHWKyL3cXkYsQXOsrlf6ZkU3dpqKtF89yU4GezrtQl/e4b98catm/BZevvA3NUHdn RrExX+AjG5ef5CXmt5fTsGjypvLfHRuSQCVVgsFJqZY/Ed7kJbGVfK76Xgw2iheopeAc 4Ucvuij8yscX0OsyC5gavwHAN5AaX0TPP5YLJeexhtPrTNVfnHdCbn7O38xLBTGyKyno +Eq6EL5pJ6Lr36fCmfVKTqBEOxoPa1ru4sV3WsWjVJFmu65yDHlm319xe9Yubg2fcZJ4 ZKCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=YM/B4+Pz7qJyTwafd9QvTtMIdTipyoRUix7Yx/HB7Pc=; b=ffXT1p9r16Vr5bcIqcJt+Yj4kcg4eSALXov6uODzjcdt4T7mNtv6Tw7/qLApZ4Z/DF 9pHQ26On6/Q04vcwc5I1pr6PEkASPcU3lDPIaGYDXkGnKsRe9aBjK1xX3yWLoPbSSzAl 5xWvUQk0zx1UCGsnzEYeqz4HiPCIL8s7TbfXRlgp3OJ6feDKrVGgMtKYt89ukGGTj/Hx 6DqHOOZ1BFvXiuswGaT6P7V5SIjxq/Ckp3XTn8lEvjti+lWkhrT8lMY/FbaRHMXCGqRH 9Ri+DcGBXMALyVpyNjVkSITYH7IAJNakEiRAH1Nnmgwk2v9qqG8B9fkZLa7iRkez7HBd 8mdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=i//lWQEA; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e5si4692740pgn.3.2018.01.17.14.03.50; Wed, 17 Jan 2018 14:04:04 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=i//lWQEA; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753660AbeAQWCr (ORCPT + 99 others); Wed, 17 Jan 2018 17:02:47 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:34052 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750931AbeAQWCq (ORCPT ); Wed, 17 Jan 2018 17:02:46 -0500 Received: by mail-wr0-f195.google.com with SMTP id 36so20544757wrh.1 for ; Wed, 17 Jan 2018 14:02:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YM/B4+Pz7qJyTwafd9QvTtMIdTipyoRUix7Yx/HB7Pc=; b=i//lWQEAsuGU4I1qGFNAR2aydy1neTIHy6Gq3339GlUelB8Gn3A1l116jXXmGxphqB nLnpChS9SaQmYS80VDRpSYXIkKfYO5Wzu50xHtHjPjQwxpUWHo2F8cUCGUN8UtyVcilI Ed/QMJtqoBbxjYX0B7jdLDIegY5/VyFiyrcGcIBlg5mwU8oZBaJxfm7AFFNzEFcAR1Do JmdsiFeeKNGQ93Sod06ToQNxz3kry4QcGdnSAAIuE8Fo04Y+gThJ3pzr36GsDfnT9R9U 1UZ0LJSF1FKWRB6v8IQHEPXU4zlPvKNu5zt6TJxFO2dDEWGCEmAt96mtdn6dI2SUl3aU GEUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=YM/B4+Pz7qJyTwafd9QvTtMIdTipyoRUix7Yx/HB7Pc=; b=XvKJ9am3HwVNn/7sO2GcKN88EnsQ6oQQVPv60mP59PmfIWqmfad9fBNF7r7tLIhuTi RqWzk4rG7RRzZ0XySRIDuiom4tWkJkSYU5QYuCNPim2+CAkcdu8u2k64zO5TwuIWXcQG 8UD9qWlCHifc/U8JPysYkAu6JWB7Kp4bECYHU23JiD5JvZXG9N952LN9ndy+wgWBck2l 9P+vKdALhnGmhjO2o9XGQUtUbwapXBgiq5+3e/wtG/VD/LVTlTSEeOYF4v7Z0mPYLpNq +V3VmXQvw9ymosK/HfBGIcT1t4cEjzfgb2mYJYY4Vmm+vS9yotSvbHWi9ma++vgNYs6Y 3Jgg== X-Gm-Message-State: AKwxyteLNPIGPktmZLGNlDGUi5E7d2vgX6BvkEUNdzw/WuPt9P1iqiNc fbxm3FkbH3ssvfNhA9TA35EfYhvqwyzXjLWZ4oQIOw== X-Received: by 10.223.133.197 with SMTP id 5mr4167364wru.167.1516226564781; Wed, 17 Jan 2018 14:02:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.147.15 with HTTP; Wed, 17 Jan 2018 14:02:43 -0800 (PST) In-Reply-To: References: <1515782670.7007.3.camel@gmx.de> <20180117.153049.1803664333084879932.davem@davemloft.net> <20180117.164932.1269304606476934540.davem@davemloft.net> From: Eric Dumazet Date: Wed, 17 Jan 2018 14:02:43 -0800 Message-ID: Subject: Re: [RFC 1/2] softirq: Defer net rx/tx processing to ksoftirqd context To: Thomas Gleixner Cc: Linus Torvalds , David Miller , Mike Galbraith , Peter Zijlstra , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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();