From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752856AbcEJUwT (ORCPT ); Tue, 10 May 2016 16:52:19 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:43637 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751625AbcEJUwS convert rfc822-to-8bit (ORCPT ); Tue, 10 May 2016 16:52:18 -0400 Date: Tue, 10 May 2016 16:52:15 -0400 (EDT) Message-Id: <20160510.165215.1602157973141296642.davem@davemloft.net> To: riel@redhat.com Cc: pabeni@redhat.com, eric.dumazet@gmail.com, netdev@vger.kernel.org, edumazet@google.com, jiri@mellanox.com, daniel@iogearbox.net, ast@plumgrid.com, aduyck@mirantis.com, tom@herbertland.com, peterz@infradead.org, mingo@kernel.org, hannes@stressinduktion.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 0/2] net: threadable napi poll loop From: David Miller In-Reply-To: <1462913455.16365.12.camel@redhat.com> References: <1462911770.5333.11.camel@redhat.com> <20160510.164538.1375529074383780155.davem@davemloft.net> <1462913455.16365.12.camel@redhat.com> X-Mailer: Mew version 6.6 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 10 May 2016 13:52:17 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rik van Riel Date: Tue, 10 May 2016 16:50:56 -0400 > On Tue, 2016-05-10 at 16:45 -0400, David Miller wrote: >> From: Paolo Abeni >> Date: Tue, 10 May 2016 22:22:50 +0200 >> >> > On Tue, 2016-05-10 at 09:08 -0700, Eric Dumazet wrote: >> >> On Tue, 2016-05-10 at 18:03 +0200, Paolo Abeni wrote: >> >>  >> >> > If a single core host is under network flood, i.e. ksoftirqd is >> >> > scheduled and it eventually (after processing ~640 packets) will >> let the >> >> > user space process run. The latter will execute a syscall to >> receive a >> >> > packet, which will have to disable/enable bh at least once and >> that will >> >> > cause the processing of another ~640 packets. To receive a >> single packet >> >> > in user space, the kernel has to process more than one thousand >> packets. >> >>  >> >> Looks you found the bug then. Have you tried to fix it ? >>  ... >> > The ksoftirq and the local_bh_enable() design are the root of the >> > problem, they need to be touched/affected to solve it. >> >> That's not what I read from your description, processing 640 packets >> before going to ksoftirqd seems to the be the absolute root problem. > > What would a fix for that look like? > > Keep track of the number of processed incoming packets, > and the number of packets handed off, and defer to > ksoftirqd earlier if the statistics suggest packets are > getting dropped on the floor? Not by packet count but by something more easily to measure and scalable to fairness like processing time.