All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: ap420073@gmail.com
Cc: kuba@kernel.org, netdev@vger.kernel.org, xiyou.wangcong@gmail.com
Subject: Re: [PATCH net 0/3] net: core: fix a lockdep splat in the dev_addr_list.
Date: Mon, 28 Sep 2020 15:14:10 -0700 (PDT)	[thread overview]
Message-ID: <20200928.151410.232993869895631044.davem@davemloft.net> (raw)
In-Reply-To: <20200925181246.25090-1-ap420073@gmail.com>

From: Taehee Yoo <ap420073@gmail.com>
Date: Fri, 25 Sep 2020 18:12:46 +0000

> This patchset is to avoid lockdep splat.
> 
> When a stacked interface graph is changed, netif_addr_lock() is called
> recursively and it internally calls spin_lock_nested().
> The parameter of spin_lock_nested() is 'dev->lower_level',
> this is called subclass.
> The problem of 'dev->lower_level' is that while 'dev->lower_level' is
> being used as a subclass of spin_lock_nested(), its value can be changed.
> So, spin_lock_nested() would be called recursively with the same
> subclass value, the lockdep understands a deadlock.
> In order to avoid this, a new variable is needed and it is going to be
> used as a parameter of spin_lock_nested().
> The first and second patch is a preparation patch for the third patch.
> In the third patch, the problem will be fixed.
> 
> The first patch is to add __netdev_upper_dev_unlink().
> An existed netdev_upper_dev_unlink() is renamed to
> __netdev_upper_dev_unlink(). and netdev_upper_dev_unlink()
> is added as an wrapper of this function.
> 
> The second patch is to add the netdev_nested_priv structure.
> netdev_walk_all_{ upper | lower }_dev() pass both private functions
> and "data" pointer to handle their own things.
> At this point, the data pointer type is void *.
> In order to make it easier to expand common variables and functions,
> this new netdev_nested_priv structure is added.
> 
> The third patch is to add a new variable 'nested_level'
> into the net_device structure.
> This variable will be used as a parameter of spin_lock_nested() of
> dev->addr_list_lock.
> Due to this variable, it can avoid lockdep splat.

Series applied, thank you.

      reply	other threads:[~2020-09-28 23:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 18:12 [PATCH net 0/3] net: core: fix a lockdep splat in the dev_addr_list Taehee Yoo
2020-09-28 22:14 ` 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=20200928.151410.232993869895631044.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=ap420073@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    /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 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.