On Mon 12 Nov 2018 at 17:28, David Miller <da...@davemloft.net> wrote: > From: Vlad Buslov <vla...@mellanox.com> > Date: Mon, 12 Nov 2018 09:55:30 +0200 > >> +void mini_qdisc_pair_swap(struct mini_Qdisc_pair *miniqp, >> + struct tcf_proto *tp_head) >> +{ >> + xchg(&miniqp->tp_head, tp_head); > > If you are not checking the return value of xchg(), then this is > simply a store with optionally a memory barrier of some sort > either before or after.
That was my intention. What would be a better way to atomically reset a pointer? Should I just change this line to explicit assignment+barrier?