Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753664AbeAKEpB (ORCPT + 1 other); Wed, 10 Jan 2018 23:45:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:41332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752922AbeAKEpA (ORCPT ); Wed, 10 Jan 2018 23:45:00 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A597E21104 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=frederic@kernel.org Date: Thu, 11 Jan 2018 05:44:57 +0100 From: Frederic Weisbecker To: Linus Torvalds Cc: Dmitry Safonov , Eric Dumazet , 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" , Peter Zijlstra , Radu Rendec , Rik van Riel , Stanislaw Gruszka , Thomas Gleixner , Wanpeng Li Subject: Re: [RFC 1/2] softirq: Defer net rx/tx processing to ksoftirqd context Message-ID: <20180111044456.GC11633@lerouge> References: <20180109133623.10711-1-dima@arista.com> <20180109133623.10711-2-dima@arista.com> <1515620880.3350.44.camel@arista.com> <20180111032232.GA11633@lerouge> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Wed, Jan 10, 2018 at 08:19:49PM -0800, Linus Torvalds wrote: > On Wed, Jan 10, 2018 at 7:22 PM, Frederic Weisbecker > wrote: > > > > Makes sense, but I think you need to keep the TASK_RUNNING check. > > Yes, good point. > > > So perhaps it should be: > > > > - return tsk && (tsk->state == TASK_RUNNING); > > + return (tsk == current) && (tsk->state == TASK_RUNNING); > > Looks good to me - definitely worth trying. > > Maybe that weakens the thing so much that it doesn't actually help the > UDP packet storm case? > > And maybe it's not sufficient for the dvb issue. > > But I think it's worth at least testing. Maybe it makes neither side > entirely happy, but maybe it might be a good halfway point? Yes I believe Dmitry is facing a different problem where he would rather see ksoftirqd scheduled more often to handle the queue as a deferred batch instead of having it served one by one on the tails of IRQ storms. (Dmitry correct me if I misunderstood). But your patch still seems to make sense for the case you described: when ksoftirqd is voluntarily preempted off and the current IRQ could handle the queue.