Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932916AbeAKVNs (ORCPT + 1 other); Thu, 11 Jan 2018 16:13:48 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:36780 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932290AbeAKVNq (ORCPT ); Thu, 11 Jan 2018 16:13:46 -0500 X-Google-Smtp-Source: ACJfBot3kI3928hoh6lFRLb28hRd71Vs6FXAk3uPAL+imxU8XKQFfiIeNEeVRaNhNnw2/B6pRCCOww== Message-ID: <1515705222.3039.33.camel@arista.com> Subject: Re: [RFC 1/2] softirq: Defer net rx/tx processing to ksoftirqd context From: Dmitry Safonov To: Eric Dumazet Cc: Linus Torvalds , Peter Zijlstra , Frederic Weisbecker , 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 Date: Thu, 11 Jan 2018 21:13:42 +0000 In-Reply-To: References: <20180109133623.10711-1-dima@arista.com> <20180109133623.10711-2-dima@arista.com> <1515620880.3350.44.camel@arista.com> <20180111032232.GA11633@lerouge> <20180111044456.GC11633@lerouge> <1515681091.3039.21.camel@arista.com> <20180111163204.GE6176@hirez.programming.kicks-ass.net> <1515702883.3039.27.camel@arista.com> <1515703586.3039.30.camel@arista.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.24.6 (3.24.6-1.fc26) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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. -- Thanks, Dmitry