Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754239AbeALFlQ (ORCPT + 1 other); Fri, 12 Jan 2018 00:41:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:58606 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750807AbeALFlO (ORCPT ); Fri, 12 Jan 2018 00:41:14 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CCC4C21746 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=frederic@kernel.org Date: Fri, 12 Jan 2018 06:41:11 +0100 From: Frederic Weisbecker To: Dmitry Safonov Cc: Eric Dumazet , Linus Torvalds , Peter Zijlstra , LKML , Dmitry Safonov <0x7f454c46@gmail.com>, Andrew Morton , David Miller , Frederic Weisbecker , Hannes Frederic Sowa , Ingo Molnar , "Levin, Alexander (Sasha Levin)" , Paolo Abeni , "Paul E. McKenney" , Radu Rendec , Rik van Riel , Stanislaw Gruszka , Thomas Gleixner , Wanpeng Li Subject: Re: [RFC 1/2] softirq: Defer net rx/tx processing to ksoftirqd context Message-ID: <20180112054110.GA26760@lerouge> References: <1515702883.3039.27.camel@arista.com> <1515703586.3039.30.camel@arista.com> <1515705222.3039.33.camel@arista.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1515705222.3039.33.camel@arista.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Thu, Jan 11, 2018 at 09:13:42PM +0000, Dmitry Safonov wrote: > On Thu, 2018-01-11 at 12:53 -0800, Eric Dumazet wrote: > > On Thu, Jan 11, 2018 at 12:46 PM, Dmitry Safonov > > wrote: > > > On Thu, 2018-01-11 at 12:40 -0800, Linus Torvalds wrote: > > > > On Thu, Jan 11, 2018 at 12:34 PM, Dmitry Safonov > > > > > > > > wrote: > > > > > > > > > > I could try to write a PoC for that.. > > > > > What should be the trigger to fall into workqueue? > > > > > How to tell if there're too many softirqs of the kind? > > > > > > > > I suspect it would have to be time-based, probably using the > > > > scheduler clock. > > > > > > I thought about this, but I was a bit afraid of how much pricey it > > > would be recalculate it each clock. Well, might just try to write > > > that > > > and measure the impact. > > > > > > > Most softirqs are really really small. So just counting them > > > > probably > > > > isn't all that meaningful, although the count is good as a > > > > fallback > > > > (as shown by the jiffy issues). > > > > > > > > The good news is that we only have a fairly small handful of > > > > softirqs, > > > > so counting/timing them separately is still mainly a pretty small > > > > array (which needs to be percpu, of course). > > > > Note that using (scheduler) clock might also help to break > > net_rx_action() > > not on a stupid netdev_budget, but on a more precise time limit as > > well. > > > > netdev_budget of 300 packets is quite big :/ > > > > (The time_limit based on jiffies + 2 does not work on hosts with one > > cpu, since jiffies wont make progress while net_rx_action() is > > running) > > Thanks for the details, Eric. > I'll try to come up with poc if no one beats me at it. I just gave it a try. Sorry I couldn't resist :-s