Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965083AbeALSKK convert rfc822-to-8bit (ORCPT + 1 other); Fri, 12 Jan 2018 13:10:10 -0500 Received: from mout.gmx.net ([212.227.17.20]:52653 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964803AbeALSKJ (ORCPT ); Fri, 12 Jan 2018 13:10:09 -0500 Message-ID: <1515780530.21898.40.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 19:08:50 +0100 In-Reply-To: <20180112170033.GD1950@lerouge> References: <1515734588.10188.36.camel@gmx.de> <20180112145819.GC1950@lerouge> <1515770104.21898.13.camel@gmx.de> <20180112170033.GD1950@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:Fy98VJEMoCHWxu/o21dfGGB1cXRbbTaVWll2mT05frH5+VPcOkw MGYOfb7kVwlrdqTzcDD1kR5oSza/8ZBFfo4bk4ocBnSHmzqJ2pZzDVOJpnHwpsWqQS+5KWB xdhKLCeTqt4X4YcWymwNtLOOPLGRUtzgmjLIJElLN6Phe+sfcgfcjmcO7sWF4JzMKVuvoIF 6imFviU3Wapjf2xrwS0qw== X-UI-Out-Filterresults: notjunk:1;V01:K0:O7xwp93gGOg=:pj52hMXq+ZKJiDC1lveRGu cLQt/zXqWTUdUawnK7HbzdsoVO2XXzOawmNsYyj1nzL4Et2SCqAnLCQUdiW6F0zBou5bUlXjY 8J6w/wqNzeRuKp0Djy5O/W7JEe1MD3+SaHRUAxZKLGsyWH9yzh4ax68Rl9bTKbTRb+9pDo2DU D3Q7CX8dGPt7RIlw1OhWcHLYhqflGDHbDNiuNhk8hxfOuCo5zXJHIYijCGIY3i6fIkZLUTf7r /zUQcix++ulviwwj2z+Pj4YuW3oAcLIZWb82YKoqlucvyjG0cji9CC5p5TH/CykU57eKh8aA4 4M6zelYPDKFOUyvqx3OMea9An+dBmRH4FUMCTfKlBNtRAYYviGgKnx4xvPAPntcZwzTM/7Q6d NSaDS17r/S4U4XC0PlV9HCYdIUzQ4nNAxHeRTw1Ja7lRbblGl7SfbhpIFTU/dBbZNlp+pfs4Y kV/JfItpoVyPJp2K7m9E7heM26Hu9pBACMON9KV43v9R+Mj1VFDcHE0uLHwOmWLk0GAVimiqu 5qPiyUOQeP9DE68BC4W7m1TCjaXhe6Wq+R3OobHwY6IAHqn7dXFYTP1rHIAgr49R+hLM4IBTb BmsbSRn9Fmdl8RgGDcVZ5hTOwobsL1lEQ44i/bLNEaJjSd5DPBQeqBjIbKRGixEBNEVSKAh7q xWRUmvOEg0egjOZgrI7HLrr1CRlDk1lasajHcdBuniO9RR3QYMi2ASgBBkxQTRkc21Ura/RMo yi+vdjID90nyRnasQPrhKMsUE3ux6R1tlAORoKn8u4UpK1jDnkXv02uHjqIxq09qglTkTsp7v eHPbF+QelfhkodDmx2SQ7Cx2LYcbwn3S7X7MfXbI6FL1wRKfdc= 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 18:00 +0100, Frederic Weisbecker wrote: > On Fri, Jan 12, 2018 at 04:15:04PM +0100, Mike Galbraith wrote: > > 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. > > How useful system_highpri_wq can be in this regard? Not at all. ?You could make the system protect itself via boosting, but that just makes a noisy mess. -Mike