[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171106124454.GI3165@worktop.lehotels.local>
Date: Mon, 6 Nov 2017 13:44:54 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Florian Westphal <fw@...len.de>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH net-next 2/8] rtnetlink: add rtnl_register_module
On Mon, Nov 06, 2017 at 11:51:07AM +0100, Florian Westphal wrote:
> @@ -180,6 +164,12 @@ int __rtnl_register(int protocol, int msgtype,
> rcu_assign_pointer(rtnl_msg_handlers[protocol], tab);
> }
>
> + WARN_ON(tab[msgindex].owner && tab[msgindex].owner != owner);
> +
> + tab[msgindex].owner = owner;
> + /* make sure owner is always visible first */
> + smp_wmb();
> +
> if (doit)
> tab[msgindex].doit = doit;
> if (dumpit)
> @@ -235,6 +279,9 @@ int rtnl_unregister(int protocol, int msgtype)
> handlers[msgindex].doit = NULL;
> handlers[msgindex].dumpit = NULL;
> handlers[msgindex].flags = 0;
> + /* make sure we clear owner last */
> + smp_wmb();
> + handlers[msgindex].owner = NULL;
> rtnl_unlock();
>
> return 0;
These wmb()'s don't make sense; and the comments are incomplete. What do
they pair with? Who cares about this ordering?
Powered by blists - more mailing lists