[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220311100611.2993ff4e@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Fri, 11 Mar 2022 10:06:11 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Leon Romanovsky <leonro@...dia.com>
Cc: <idosch@...dia.com>, <petrm@...dia.com>,
<simon.horman@...igine.com>, <netdev@...r.kernel.org>,
<jiri@...nulli.us>
Subject: Re: [RFT net-next 1/6] devlink: expose instance locking and add
locked port registering
On Fri, 11 Mar 2022 19:49:36 +0200 Leon Romanovsky wrote:
> > No, no, that function is mostly for rcu dereference checking.
> > The calls should be eliminated as dead code on production systems.
>
> On systems without LOCKDEP, the devl_lock_is_held function will be
> generated to be like this:
> bool devl_lock_is_held(struct devlink *devlink)
> {
> return WARN_ON_ONCE(true);
> }
> EXPORT_SYMBOL_GPL(devl_lock_is_held);
I think you missed my first sentence. Anyway, this is what I'll do in
v1:
#ifdef CONFIG_LOCKDEP
/* For use in conjunction with LOCKDEP only e.g. rcu_dereference_protected() */
bool devl_lock_is_held(struct devlink *devlink)
{
return lockdep_is_held(&devlink->lock);
}
EXPORT_SYMBOL_GPL(devl_lock_is_held);
#endif
Powered by blists - more mailing lists