netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: xiyou.wangcong@gmail.com, davem@davemloft.net
Cc: netdev@vger.kernel.org, jhs@mojatatu.com, eric.dumazet@gmail.com
Subject: [net-next PATCH v1 2/3] net: sched: cls_cgroup tear down exts and ematch from rcu callback
Date: Sun, 05 Oct 2014 21:28:20 -0700	[thread overview]
Message-ID: <20141006042819.6010.32857.stgit@nitbit.x32> (raw)
In-Reply-To: <20141006042335.6010.27000.stgit@nitbit.x32>

It is not RCU safe to destroy the action chain while there
is a possibility of readers accessing it. Move this code
into the rcu callback using the same rcu callback used in the
code patch to make a change to head.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
 net/sched/cls_cgroup.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c
index 2f77a89..d61a801 100644
--- a/net/sched/cls_cgroup.c
+++ b/net/sched/cls_cgroup.c
@@ -156,10 +156,8 @@ static void cls_cgroup_destroy(struct tcf_proto *tp)
 	struct cls_cgroup_head *head = rtnl_dereference(tp->root);
 
 	if (head) {
-		tcf_exts_destroy(&head->exts);
-		tcf_em_tree_destroy(&head->ematches);
 		RCU_INIT_POINTER(tp->root, NULL);
-		kfree_rcu(head, rcu);
+		call_rcu(&head->rcu, cls_cgroup_destroy_rcu);
 	}
 }
 

  parent reply	other threads:[~2014-10-06  4:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-06  4:27 [net-next PATCH v1 0/3] net sched rcu updates John Fastabend
2014-10-06  4:27 ` [net-next PATCH v1 1/3] net: sched: remove tcf_proto from ematch calls John Fastabend
2014-10-06 16:52   ` Cong Wang
2014-10-06  4:28 ` John Fastabend [this message]
2014-10-06 17:01   ` [net-next PATCH v1 2/3] net: sched: cls_cgroup tear down exts and ematch from rcu callback Cong Wang
2014-10-06  4:28 ` [net-next PATCH v1 3/3] net: sched: do not use tcf_proto 'tp' argument from call_rcu John Fastabend
2014-10-06 17:05   ` Cong Wang
2014-10-06 22:03 ` [net-next PATCH v1 0/3] net sched rcu updates David Miller

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=20141006042819.6010.32857.stgit@nitbit.x32 \
    --to=john.fastabend@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).