Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964851AbeALRYR (ORCPT + 1 other); Fri, 12 Jan 2018 12:24:17 -0500 Received: from mail-io0-f174.google.com ([209.85.223.174]:36984 "EHLO mail-io0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932859AbeALRYQ (ORCPT ); Fri, 12 Jan 2018 12:24:16 -0500 X-Google-Smtp-Source: ACJfBouXjt7cL4igVqUBEnEuTk/C3rWM0PpNR25+uW+9DiLPQxmwRBVISZmv5NneqFkS1Qoj1ey0ce0aFxU6okfQzAY= MIME-Version: 1.0 In-Reply-To: <1515734588.10188.36.camel@gmx.de> 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> <1515734588.10188.36.camel@gmx.de> From: Linus Torvalds Date: Fri, 12 Jan 2018 09:24:14 -0800 X-Google-Sender-Auth: 08nxDNWlQg-pQeSaNZUGsLKWHfw Message-ID: Subject: Re: [RFC 1/2] softirq: Defer net rx/tx processing to ksoftirqd context To: Mike Galbraith Cc: Eric Dumazet , Peter Zijlstra , Dmitry Safonov , 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 Content-Type: text/plain; charset="UTF-8" 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 9:23 PM, Mike Galbraith wrote: > On Thu, 2018-01-11 at 12:22 -0800, Linus Torvalds wrote: >> >> So maybe we could get rid of the per-cpu ksoftirqd entirely, and >> replace it with with per-cpu and per-softirq workqueues? > > How would that be better than what RT used to do, and I still do for my > RT kernels via boot option, namely split ksoftirqd into per-softirq > threads. So I think testing and playing around with things is probably the way to go, but the reason I would suggest at least looking at workqueues is that I feel that we already have a *ton* of percpu threads, and multiplying the ksoftirqd threads by a factor of ten (or however many softirqs we have) sounds insane. And yes, they do need to be percpu. Networking wants to do all that packet handling concurrently across CPUs, so we can't just replace the per-cpu ksoftirqd threads with per-softirq threads: we really do want both per-cpu _and_ per-softirq. And honestly, that sounds insane to do with dedicated threads, most of which do basically nothing at all.. And it's what the workqueue threads are designed for - expanding as needed, and not tying up a dedicated thread for every little work. But code and testing talks, Linus