Re: [PATCH] rtnl: Simplify ASSERT_RTNL

David Miller
2007-10-11T04:16:51Z

From: ebiederm@xmission.com (Eric W. Biederman)
Date: Fri, 28 Sep 2007 18:59:08 -0600

>
> Currently we have the call path:
> macvlan_open -> dev_unicast_add -> __dev_set_rx_mode ->
> __dev_set_promiscuity -> ASSERT_RTNL -> mutex_trylock
>
> When mutex debugging is on taking a mutex complains if we are not
> allowed to sleep. At that point we have called netif_tx_lock_bh
> so we are clearly not allowed to sleep. Arguably this is not a
> problem for mutex_trylock.
>
> However we can avoid the complaint and make the ASSERT_RTNL code
> cheaper, faster and more obvious by simply calling mutex_is_locked.
>
> So this patch adds rtnl_is_locked (which does mutex_is_locked on
> the rtnl_mutex) and changes ASSERT_RTNL to use that.
>
> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>

There was a lot of discussion about how to do this right and
therefore you'll need to resubmit all of this with this
discussioned issues addressed.