From patchwork Mon Apr 20 12:38:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 227458 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52169C3A5A0 for ; Mon, 20 Apr 2020 12:47:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 258DF2072B for ; Mon, 20 Apr 2020 12:47:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587386843; bh=X+b+QV3PvZjiosKYrqlH8COZv8vfZjJYoAlH/tuFyhE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=2W4Ki8vvJ3OG1ZOQMkpIf84LQjq/PC2fnHSWw1fyJk1z22oR8scu+cZWfYf5P/XAR 7ooNEHQNUHKg4izdK5ez+q1AgiwRf2WMx1h9M8ig8tzTnZ5vEFftEiApnirGpjzZCN 7uJYEN/BIBgtCSNbgPWzrKczaULlNS58rBXlMYXY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728496AbgDTMrW (ORCPT ); Mon, 20 Apr 2020 08:47:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:43276 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729071AbgDTMrV (ORCPT ); Mon, 20 Apr 2020 08:47:21 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6D91422242; Mon, 20 Apr 2020 12:47:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587386840; bh=X+b+QV3PvZjiosKYrqlH8COZv8vfZjJYoAlH/tuFyhE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1Oo95t4VBiyVYqmSa/u35cGd1YnJf+cZAn1n9F9J0DDu/SVgySVv5tpaEDsg764lU Q+0/KkhoSTICAO94nmYS8j8eWwx2GcbJVFTM2ZxUUeHaihDVE8oQbtrxarsU1tnFx/ 7U8lX/6ja8+9WX+vSmZGHJrYer5alcscDEziS06E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Yakunin , Konstantin Khlebnikov , "David S. Miller" Subject: [PATCH 5.4 09/60] net: revert default NAPI poll timeout to 2 jiffies Date: Mon, 20 Apr 2020 14:38:47 +0200 Message-Id: <20200420121503.672835099@linuxfoundation.org> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200420121500.490651540@linuxfoundation.org> References: <20200420121500.490651540@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Konstantin Khlebnikov [ Upstream commit a4837980fd9fa4c70a821d11831698901baef56b ] For HZ < 1000 timeout 2000us rounds up to 1 jiffy but expires randomly because next timer interrupt could come shortly after starting softirq. For commonly used CONFIG_HZ=1000 nothing changes. Fixes: 7acf8a1e8a28 ("Replace 2 jiffies with sysctl netdev_budget_usecs to enable softirq tuning") Reported-by: Dmitry Yakunin Signed-off-by: Konstantin Khlebnikov Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3863,7 +3863,8 @@ EXPORT_SYMBOL(netdev_max_backlog); int netdev_tstamp_prequeue __read_mostly = 1; int netdev_budget __read_mostly = 300; -unsigned int __read_mostly netdev_budget_usecs = 2000; +/* Must be at least 2 jiffes to guarantee 1 jiffy timeout */ +unsigned int __read_mostly netdev_budget_usecs = 2 * USEC_PER_SEC / HZ; int weight_p __read_mostly = 64; /* old backlog weight */ int dev_weight_rx_bias __read_mostly = 1; /* bias for backlog weight */ int dev_weight_tx_bias __read_mostly = 1; /* bias for output_queue quota */