[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOrHB_AWdZw1XDmxVU=bDh=gB2M3cnXUC8MyXCnV1YVjZEAsKw@mail.gmail.com>
Date: Sun, 10 Jan 2016 22:38:22 -0800
From: pravin shelar <pshelar@....org>
To: Hannes Frederic Sowa <hannes@...essinduktion.org>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH net] net: reduce RECURSION_LIMIT to 8
On Thu, Jan 7, 2016 at 9:40 AM, Hannes Frederic Sowa
<hannes@...essinduktion.org> wrote:
> 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.
>
Major user of stack space in OVS is sw_flow_key in
ovs_vport_receive(). With recent features like IPv6 tunnel support we
have increased the size of the flow-key which could have caused the
stack overflow sooner.
One way to avoid using stack in subsequent recursive call is to use
per-cpu storage for the sw_flow_key object. This is already done for
OVS recursive actions, so we can expand on that facility.
> 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@...emloft.net>
> Cc: Eric Dumazet <edumazet@...gle.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@...essinduktion.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
>
Powered by blists - more mailing lists