Received: by 10.223.148.5 with SMTP id 5csp6482955wrq; Wed, 17 Jan 2018 14:27:01 -0800 (PST) X-Google-Smtp-Source: ACJfBovjChjdkJJN73zo3wqh8dFJlDSTghQsyuP+snYXkck2+vXGNuoDa5hpAoXj7w7pO3Aql4vY X-Received: by 10.99.50.7 with SMTP id y7mr34832478pgy.240.1516228021458; Wed, 17 Jan 2018 14:27:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516228021; cv=none; d=google.com; s=arc-20160816; b=eK5KXmDsHuBlK+X0W1nd0pB+MM76zsulFk/+yTodmobani/PXAarDQCVYLnnnrMi9y Zs0bmDhrysZVc4AVmQvKtywS36RPHXzLk+ckWe3p/wPjx+/ZZG58oJqR0qWnx9FWuebr GsM7X041K7TMOc0VMjgoAb49MzcBgi5dcwCxOWE0Hz04mfbaF3dxdIDLkzgc5Yz5VLKR u7EgWlYxzwnJiWMy5ViVm0dkycJsUiG8jUzYn/UHCcZFi5YGYmswhWhIMj5zxWPpC92S Z5BbNGN5f8/KMhq6us9dxCPplz7Mra+9M4qnMTQHGc6AMV7vXZNQ+RQ9TjtlKOCwcvaU Wr9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date :arc-authentication-results; bh=Z6R3nAXoxalmycuQnqNZJ9NPxa4dI2/gZo7QwVRfFfA=; b=Xp3tl88h/ROCJXsQyAox0527mfsQvO5loJQ6XYmUSay4ItFB8wVgdA36SUMQZ6jW1m BDRr78O6TXpz6ekxLcPzPuTWXBMld1CIuoDCbfGiKYCGyPghkoNN87zPiKsp3hlcgPrD cmR9BuKbAFK7MItZlpSzjuVL0hiBQPJIWc9XABkz04twJ1X1T+ODL+ixBPk9i+ZVuPKR 4L3JZwA+Z8FYmSUR8YZkcicXBPfia5cyvz2uZ/n/M6kWQRQX7uA5QABTfnSXXsoVUR3/ 3w6+npm2R7vhCzoGM9ZOg6StODpXhszZ/SootAyrQlxReMCjj8BFzcUB+a2d6pQxNbJy mbNg== 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 f12si4588770pga.22.2018.01.17.14.26.47; Wed, 17 Jan 2018 14:27:01 -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 S1754552AbeAQWYw (ORCPT + 99 others); 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 Received: from localhost (67.110.78.66.ptr.us.xo.net [67.110.78.66]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 67E9410894297; Wed, 17 Jan 2018 14:24:48 -0800 (PST) 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 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 17 Jan 2018 14:24:49 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk 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.