public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail•com>
To: Eric Dumazet <eric.dumazet@gmail•com>
Cc: xiyou.wangcong@gmail•com, davem@davemloft•net, jhs@mojatatu•com,
	netdev@vger•kernel.org, paulmck@linux•vnet.ibm.com,
	brouer@redhat•com
Subject: Re: [net-next PATCH v3 07/15] net: sched: RCU cls_route
Date: Tue, 09 Sep 2014 09:24:02 -0700	[thread overview]
Message-ID: <540F29A2.8050805@gmail.com> (raw)
In-Reply-To: <1410267553.11872.167.camel@edumazet-glaptop2.roam.corp.google.com>

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@intel•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

  reply	other threads:[~2014-09-09 16:24 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09  5:53 [net-next PATCH v3 00/15] net/sched use rcu filters John Fastabend
2014-09-09  5:54 ` [net-next PATCH v3 01/15] net: qdisc: use rcu prefix and silence sparse warnings John Fastabend
2014-09-09 12:05   ` Eric Dumazet
2014-09-09  5:54 ` [net-next PATCH v3 02/15] net: rcu-ify tcf_proto John Fastabend
2014-09-09 12:20   ` Eric Dumazet
2014-09-09 15:15     ` John Fastabend
2014-09-09 15:20       ` Eric Dumazet
2014-09-09  5:55 ` [net-next PATCH v3 03/15] net: sched: cls_basic use RCU John Fastabend
2014-09-09 12:29   ` Eric Dumazet
2014-09-09  5:55 ` [net-next PATCH v3 04/15] net: sched: cls_cgroup " John Fastabend
2014-09-09 12:34   ` Eric Dumazet
2014-09-09  5:56 ` [net-next PATCH v3 05/15] net: sched: cls_flow " John Fastabend
2014-09-09 12:41   ` Eric Dumazet
2014-09-09 16:09     ` John Fastabend
2014-09-09 16:20       ` Eric Dumazet
2014-09-09  5:56 ` [net-next PATCH v3 06/15] net: sched: fw " John Fastabend
2014-09-09 12:48   ` Eric Dumazet
2014-09-09  5:57 ` [net-next PATCH v3 07/15] net: sched: RCU cls_route John Fastabend
2014-09-09 12:59   ` Eric Dumazet
2014-09-09 16:24     ` John Fastabend [this message]
2014-09-09  5:57 ` [net-next PATCH v3 08/15] net: sched: RCU cls_tcindex John Fastabend
2014-09-09  5:58 ` [net-next PATCH v3 09/15] net: sched: make cls_u32 lockless John Fastabend
2014-09-09 13:20   ` Eric Dumazet
2014-09-09 16:35     ` John Fastabend
2014-09-09 18:02   ` Cong Wang
2014-09-10  4:53     ` John Fastabend
2014-09-09  5:58 ` [net-next PATCH v3 10/15] net: sched: rcu'ify cls_rsvp John Fastabend
2014-09-09 13:27   ` Eric Dumazet
2014-09-09 16:46     ` John Fastabend
2014-09-09  5:59 ` [net-next PATCH v3 11/15] net: sched: rcu'ify cls_bpf John Fastabend
2014-09-09  5:59 ` [net-next PATCH v3 12/15] net: sched: make tc_action safe to walk under RCU John Fastabend
2014-09-09  6:00 ` [net-next PATCH v3 13/15] net: sched: make bstats per cpu and estimator RCU safe John Fastabend
2014-09-09  6:00 ` [net-next PATCH v3 14/15] net: sched: make qstats per cpu John Fastabend
2014-09-09  6:01 ` [net-next PATCH v3 15/15] net: sched: drop ingress qdisc lock John Fastabend

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=540F29A2.8050805@gmail.com \
    --to=john.fastabend@gmail$(echo .)com \
    --cc=brouer@redhat$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=eric.dumazet@gmail$(echo .)com \
    --cc=jhs@mojatatu$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=paulmck@linux$(echo .)vnet.ibm.com \
    --cc=xiyou.wangcong@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox