netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: fw@strlen.de
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH next RFC] net: sched: mirred: move xmit to tasklet
Date: Tue, 18 Apr 2017 13:15:48 -0400 (EDT)	[thread overview]
Message-ID: <20170418.131548.824211762596103433.davem@davemloft.net> (raw)
In-Reply-To: <20170418130331.14268-1-fw@strlen.de>

From: Florian Westphal <fw@strlen.de>
Date: Tue, 18 Apr 2017 15:03:31 +0200

> mirred is prone to deadlocks as it invokes dev_queue_xmit while
> holding one or more qdisc locks.
> 
> Avoid lock recursions by moving tx context to a tasklet.
> 
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
>  This a stab at removing the lock recursions discussed during netconf.
> 
>  Taking the cost of the tasklet appears to be the only solution;
>  i tried to use a percpu 'history' instead but its not clear to
>  me that this avoids all corner cases.
> 
>  While this patch doesn't avoid loops we don't hang the kernel
>  anymore and removing the 'looping' filter makes things calm
>  down again (there are also other ways to create such loops anyway,
>  including use of a cable... )

The thing is, those qdisc's are per-device.

So we could return the locking cpu and back out of deadlocks just like
we do for the netdev tx lock.

Given that, maybe the remaining part of the equation could possibly be
handled by a ttl.

      parent reply	other threads:[~2017-04-18 17:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18 13:03 [PATCH next RFC] net: sched: mirred: move xmit to tasklet Florian Westphal
2017-04-18 16:18 ` Eric Dumazet
2017-04-18 17:15 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170418.131548.824211762596103433.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=fw@strlen.de \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).