From patchwork Thu Jan 7 17:40:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Frederic Sowa X-Patchwork-Id: 564385 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 246BD1402DE for ; Fri, 8 Jan 2016 04:41:10 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=stressinduktion.org header.i=@stressinduktion.org header.b=TucprwFq; dkim=pass (1024-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b=VMj9wNjZ; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752285AbcAGRlE (ORCPT ); Thu, 7 Jan 2016 12:41:04 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:48859 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751220AbcAGRlB (ORCPT ); Thu, 7 Jan 2016 12:41:01 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id BFFA221658 for ; Thu, 7 Jan 2016 12:41:00 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Thu, 07 Jan 2016 12:41:00 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= stressinduktion.org; h=cc:date:from:message-id:subject:to :x-sasl-enc:x-sasl-enc; s=mesmtp; bh=6eY8/1EdWlu/cnMQkU1vlilvu6A =; b=TucprwFq9Ga3aXgO15ViW1Xz6jUJfTeZnKv4R/clzHsmKrFQGFS8DIyOK2a MAMNzR3OvVcnQ6kCLbSBmTMwQ+QK1M/vRRrdxYkbcgACV/G3Y1IfizPBra/4XvUc 5gu9igK+sYaxisNxBpPVAVAsN8bWVtoMRHQgvM3Q3gUoyLfY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:message-id:subject:to :x-sasl-enc:x-sasl-enc; s=smtpout; bh=6eY8/1EdWlu/cnMQkU1vlilvu6 A=; b=VMj9wNjZgbjT95vrAbUJJ/s4O3IiysYw+xuCter9rZQaXEe1irhq+uXte0 CgYsoqYGgmlRr7GBDAy6xWQWvszGIM/DQO+kjQgsyDw3lv9G+ypYq+957yGCog+u QuyR0yiuW7Idul22f8DFIL7D827tXAad7WhBMExHr16uZbZFw= X-Sasl-enc: eThlyuHdn4ir5XM2YMXH/isGNvEDios01xz9gZzBvicG 1452188460 Received: from z.localhost.localdomain (unknown [213.55.184.147]) by mail.messagingengine.com (Postfix) with ESMTPA id 7F0386800AD; Thu, 7 Jan 2016 12:40:59 -0500 (EST) From: Hannes Frederic Sowa To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet Subject: [PATCH net] net: reduce RECURSION_LIMIT to 8 Date: Thu, 7 Jan 2016 18:40:53 +0100 Message-Id: <1452188453-5523-1-git-send-email-hannes@stressinduktion.org> X-Mailer: git-send-email 2.5.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When RECURSION_LIMIT was first introduced, Eric proposed a limit of 3. This limit was later raised to 10 by DaveM. Nowadays it is observed that configuraion errors in openvswitch cause the STACK_END_MAGIC to be overwritten shortly after 9 recursion. This patch tries to be conservative and reduces the limit to 8 without further measurements. It seems ovs uses the stack more than other parts of the networking stack - I couldn't bring the system down with a non-ovs tunneling setup. Cc: David S. Miller Cc: Eric Dumazet Signed-off-by: Hannes Frederic Sowa --- I don't do crazy run-time estimation of the stack size for one recursion and try automatically to come up with a limit per arch or kconfig settings, as I assume that all systems should behave the same regarding the recursion maximum. All configurations should run on all kinds of systems. I consider 8 recursions to be plenty enough for the time being. net/core/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/dev.c b/net/core/dev.c index ae00b894e67555..d93da7df84325d 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2941,7 +2941,7 @@ static void skb_update_prio(struct sk_buff *skb) DEFINE_PER_CPU(int, xmit_recursion); EXPORT_SYMBOL(xmit_recursion); -#define RECURSION_LIMIT 10 +#define RECURSION_LIMIT 8 /** * dev_loopback_xmit - loop back @skb