netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jiri@resnulli.us
Cc: netdev@vger.kernel.org, idosch@mellanox.com, mlxsw@mellanox.com
Subject: Re: [patch net] mlxsw: core: Fix possible deadlock
Date: Wed, 18 Oct 2017 12:21:13 +0100 (WEST)	[thread overview]
Message-ID: <20171018.122113.2048778528438796236.davem@davemloft.net> (raw)
In-Reply-To: <20171016142828.2742-1-jiri@resnulli.us>

From: Jiri Pirko <jiri@resnulli.us>
Date: Mon, 16 Oct 2017 16:28:28 +0200

> From: Ido Schimmel <idosch@mellanox.com>
> 
> When an EMAD is transmitted, a timeout work item is scheduled with a
> delay of 200ms, so that another EMAD will be retried until a maximum of
> five retries.
> 
> In certain situations, it's possible for the function waiting on the
> EMAD to be associated with a work item that is queued on the same
> workqueue (`mlxsw_core`) as the timeout work item. This results in
> flushing a work item on the same workqueue.
> 
> According to commit e159489baa71 ("workqueue: relax lockdep annotation
> on flush_work()") the above may lead to a deadlock in case the workqueue
> has only one worker active or if the system in under memory pressure and
> the rescue worker is in use. The latter explains the very rare and
> random nature of the lockdep splats we have been seeing:
 ...
> Fix this by creating another workqueue for EMAD timeouts, thereby
> preventing the situation of a work item trying to flush a work item
> queued on the same workqueue.
> 
> Fixes: caf7297e7ab5f ("mlxsw: core: Introduce support for asynchronous EMAD register access")
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Reported-by: Jiri Pirko <jiri@mellanox.com>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>

Applied.

  reply	other threads:[~2017-10-18 11:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-16 14:28 [patch net] mlxsw: core: Fix possible deadlock Jiri Pirko
2017-10-18 11:21 ` David Miller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-10-16 14:27 [patch net-next 0/5] mlxsw: GRE: Offload decap without encap Jiri Pirko
2017-10-16 14:27 ` [patch net] mlxsw: core: Fix possible deadlock Jiri Pirko

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=20171018.122113.2048778528438796236.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=jiri@resnulli.us \
    --cc=mlxsw@mellanox.com \
    --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).