[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181113.080831.1579511935763457972.davem@davemloft.net>
Date: Tue, 13 Nov 2018 08:08:31 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: vladbu@...lanox.com
Cc: netdev@...r.kernel.org, jhs@...atatu.com, xiyou.wangcong@...il.com,
jiri@...nulli.us, ast@...nel.org, daniel@...earbox.net
Subject: Re: [PATCH net-next 01/17] net: sched: refactor
mini_qdisc_pair_swap() to use workqueue
From: Vlad Buslov <vladbu@...lanox.com>
Date: Tue, 13 Nov 2018 13:13:19 +0000
>
> On Mon 12 Nov 2018 at 17:28, David Miller <davem@...emloft.net> wrote:
>> From: Vlad Buslov <vladbu@...lanox.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?
We have all kinds of helpers in the kernel for doing things like
this, grep for things like "smp_load_acquire", "smp_store_release()"
etc.
Powered by blists - more mailing lists