All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: reduce RECURSION_LIMIT to 8
@ 2016-01-07 17:40 Hannes Frederic Sowa
  2016-01-10 22:59 ` David Miller
  2016-01-11  6:38 ` pravin shelar
  0 siblings, 2 replies; 7+ messages in thread
From: Hannes Frederic Sowa @ 2016-01-07 17:40 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Eric Dumazet

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 <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
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
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-01-12 20:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-07 17:40 [PATCH net] net: reduce RECURSION_LIMIT to 8 Hannes Frederic Sowa
2016-01-10 22:59 ` David Miller
2016-01-11  6:38 ` pravin shelar
2016-01-11 12:24   ` Hannes Frederic Sowa
2016-01-12  0:36     ` pravin shelar
2016-01-12  1:48       ` Hannes Frederic Sowa
2016-01-12 20:41         ` pravin shelar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.