[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <540F29A2.8050805@gmail.com>
Date: Tue, 09 Sep 2014 09:24:02 -0700
From: John Fastabend <john.fastabend@...il.com>
To: Eric Dumazet <eric.dumazet@...il.com>
CC: xiyou.wangcong@...il.com, davem@...emloft.net, jhs@...atatu.com,
netdev@...r.kernel.org, paulmck@...ux.vnet.ibm.com,
brouer@...hat.com
Subject: Re: [net-next PATCH v3 07/15] net: sched: RCU cls_route
On 09/09/2014 05:59 AM, Eric Dumazet wrote:
> On Mon, 2014-09-08 at 22:57 -0700, John Fastabend wrote:
>> RCUify the route classifier. For now however spinlock's are used to
>> protect fastmap cache.
>>
>> The issue here is the fastmap may be read by one CPU while the
>> cache is being updated by another. An array of pointers could be
>> one possible solution.
>
> Yep, this doesnt seem like an urgent issue anyway.
>
>>
>> Signed-off-by: John Fastabend <john.r.fastabend@...el.com>
>> ---
[...]
>> @@ -296,27 +324,35 @@ static int route4_delete(struct tcf_proto *tp, unsigned long arg)
>> h = f->handle;
>> b = f->bkt;
>>
>> - for (fp = &b->ht[from_hash(h >> 16)]; *fp; fp = &(*fp)->next) {
>> - if (*fp == f) {
>> - tcf_tree_lock(tp);
>> + fp = &b->ht[from_hash(h >> 16)];
>> + for (nf = rtnl_dereference(*fp); nf;
>> + fp = &nf->next, nf = rtnl_dereference(*fp)) {
>> + if (nf == f) {
>> + /* unlink it */
>> *fp = f->next;
>
> Strange you left this without annotations, while rest of your patches
> always use rcu_assign_pointer(*fp, rtnl_dereference(f->next)
>
> Note that it is absolutely fine to use *fp = f->next;
>
> ;)
>
I was just trying to be explicit in the other cases although I
chose rcu_assign_pointer in many cases instead of INIT_POINTER. So for
consistency I'll make this,
RCU_INIT_POINTER(*fp, rtnl_dereference(f->next))
I also thought that sparse would warn about not wrapping f->next in
rtnl_dereference, but apparently that is not the case.
>> - tcf_tree_unlock(tp);
>>
>
>
>
--
John Fastabend Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists