Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934003AbeALPQU convert rfc822-to-8bit (ORCPT + 1 other); Fri, 12 Jan 2018 10:16:20 -0500 Received: from mout.gmx.net ([212.227.17.20]:58340 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933926AbeALPQR (ORCPT ); Fri, 12 Jan 2018 10:16:17 -0500 Message-ID: <1515770104.21898.13.camel@gmx.de> Subject: Re: [RFC 1/2] softirq: Defer net rx/tx processing to ksoftirqd context From: Mike Galbraith To: Frederic Weisbecker Cc: Linus Torvalds , Eric Dumazet , Peter Zijlstra , Dmitry Safonov , 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: Fri, 12 Jan 2018 16:15:04 +0100 In-Reply-To: <20180112145819.GC1950@lerouge> References: <20180111163204.GE6176@hirez.programming.kicks-ass.net> <1515734588.10188.36.camel@gmx.de> <20180112145819.GC1950@lerouge> Content-Type: text/plain; charset="ISO-8859-15" X-Mailer: Evolution 3.20.5 Mime-Version: 1.0 Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K0:zd9t8fPlJJX1acjZrN6RYkEmOBjYCxtCIdvSd9KHCh0NKiD+8Wa g6trS79AxrC9N8dv3fJoHG1zA2l0+TCNfYwYSPKkrHQpkSDlbGcSyxEjNNAJmRv+K0Z5AOw l8PeaQI8O+2W0j53MObX2y9fLEjzFbADhRQhfp4FRY0TELc5NBTuYBAURPvGjfEEgTfYK3j 3+fH+EcoYu/xZOOcnVDBA== X-UI-Out-Filterresults: notjunk:1;V01:K0:sBAtNPKx+Qc=:oWpXrtMxV1S1yWqskc1Okr hVcH9GmdL8EbhqC87UFMNB1sWR58kImJgahH98gNcNJ7i+ffGW24kFP1fXDET5H0gTlk5vMbJ qFyZrqr0yt1/meOKkLxqtVvegsWFFaF3gYB0nUtDqr8kdGfmtm4NMHZ8tPQwehRGPoJ8DPptd Ux34V2tktfcnmYIvdbYwoaaWogq+Ys2ne7KcwzgFFyrLvSBusrGfimVoCuh3OMkgrWJvTX/Nq C6BfydYYJXrjpdUg3SmC+h6Gqq7G/K36/kJqjcAmipuQpVPK7zvudJSDgrqpBrYQei8853KUz BTsY7Z7H89LYhhBoNeFgAGO4FvIJdEDLSZB2fxIwcAeuutm0M5oWh2PxbfPsuI/8LI49Fw/vF dqOnDCC4f+CBnDLrH0mnPA0gF4+jmIR6erZDbf2JNmqruOGwzdTxPC8qF0tg+ifqtRmO5qeJE V+RHgP4P/xsx3nD3cHcPspZmK2rWUL0rkw6VbTh0HGSY9lQqoen6WP/p9yUjx4DipYohIST/s /TFLPUWPAjYIkkzASciwHvqZJwuk/8Ib80bOrVJLhsWDWrUs7Bye/C7dqs/QvDyD+apmUOwP8 vntLqy5D0pljti+vvY8oLvdSFY0SXGELmkCew4l1iHwio1zpeRwaCiJIBBMgSiw/pacoFV8rJ 9cXpR+f8wRH3qBQ7Ns3mTsEDv16iVjEO5yehIlZFtnvIYWrcITcPAHno7KMvL7f2L4DGawty1 tDT5iq7d/8p9t6ZTf1RjsWKLC3JknGPFD9dfIjb/LGd6ysH2AhiQMr3LnsG/f4vLtxPwyRQaK H/H2PmUoKK8zn1ndJ2MjyCCzWhHfgzo8/uAf7dRWFN8EShz+4g= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Fri, 2018-01-12 at 15:58 +0100, Frederic Weisbecker wrote: > On Fri, Jan 12, 2018 at 06:23:08AM +0100, Mike Galbraith wrote: > > On Thu, 2018-01-11 at 12:22 -0800, Linus Torvalds wrote: > > > On Thu, Jan 11, 2018 at 12:16 PM, Eric Dumazet wrote: > > > > > > > > Note that when I implemented TCP Small queues, I did experiments between > > > > using a work queue or a tasklet, and workqueues added unacceptable P99 > > > > latencies, when many user threads are competing with kernel threads. > > > > > > Yes. > > > > > > So I think one solution might be to have a hybrid system, where we do > > > the softirq's synchronously normally (which is what you really want > > > for good latency). > > > > > > But then fall down on a threaded model - but that fallback case should > > > be per-softirq, not global. So if one softirq uses a lot of CPU time, > > > that shouldn't affect the latency of other softirqs. > > > > > > 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. > > Workqueue are probably more simple. Unless you need to set specific prios > to your ksoftirqds? Not sure if that's tunable on workqueues. No, you can't prioritize workqueues, and they spawn threads whenever they bloody well feel like. I carry a hack to give users minimal control over kthread/workqueue priority. ?Very handy thing to have, especially if you're doing high utilization stuff, and would prefer your box actually survive it. -Mike