From mboxrd@z Thu Jan 1 00:00:00 1970 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 973ECC54FCB for ; Mon, 20 Apr 2020 12:48:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6DD63206E9 for ; Mon, 20 Apr 2020 12:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587386908; bh=cGSnqVk3XEiivt42E5/JP8PziBdXoNJf7P8/UlVSRX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=gM1iQIgRGEWG5/DpaUETIC+boWdZ6ZdW9WPrFCrfo/B1mIz+d9Zqp/qwDg0HBI+RS lvCrj/cLCieQe6rxlj5510pnksrER5DpqKsIAzx6oc9WqK3r8Luw7k/u49aHoetG8g 1B2bwQbUVtcP9/GxwNoc1XvHlvnQL3e6or7l6OZQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729250AbgDTMs1 (ORCPT ); Mon, 20 Apr 2020 08:48:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:45058 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729246AbgDTMs1 (ORCPT ); Mon, 20 Apr 2020 08:48:27 -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 25FA92072B; Mon, 20 Apr 2020 12:48:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587386906; bh=cGSnqVk3XEiivt42E5/JP8PziBdXoNJf7P8/UlVSRX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OiZe7byB0hu95WBg1OY03bkT0TwftMNBSUFq4C/XcjFMkUHcQh0zpF6yIDgX/UDt/ D/QrDoiY94E8BeaA3R5JifKAW+uog3fRvca3jspI2mfNvew613Eeq+Rrcx1UiHU8cE O/xkuXPlmRch4roxr4OR0sF+YD9ooewHHl0SMquY= 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 4.19 06/40] net: revert default NAPI poll timeout to 2 jiffies Date: Mon, 20 Apr 2020 14:39:16 +0200 Message-Id: <20200420121452.817040909@linuxfoundation.org> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200420121444.178150063@linuxfoundation.org> References: <20200420121444.178150063@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 @@ -3934,7 +3934,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 */