Re: [PATCH v2 03/10] cgroup: net_cls: Protect access to task_cls_classid() when built as module

2 messages, 2 authors, 2012-08-25 · open the first message on its own page

Re: [PATCH v2 03/10] cgroup: net_cls: Protect access to task_cls_classid() when built as module

From: Tejun Heo <hidden>
Date: 2012-08-24 23:26:21

On Fri, Aug 24, 2012 at 04:01:37PM +0200, Daniel Wagner wrote:
quoted hunk
@@ -306,6 +312,11 @@ static void __exit exit_cgroup_cls(void)
 	synchronize_rcu();
 #endif
 
+#if IS_MODULE(CONFIG_NET_CLS_CGROUP)
+	static_key_slow_dec(&cgroup_cls_enabled);
+	rcu_barrier();
Why is this rcu_barrier() necessary?  In general, please explain what
synchronization is going on when using sync constructs which aren't
obvious - e.g. memory barriers, rcu barriers.

Thanks.

-- 
tejun

Re: [PATCH v2 03/10] cgroup: net_cls: Protect access to task_cls_classid() when built as module

From: Daniel Wagner <hidden>
Date: 2012-08-25 16:56:31

On 25.08.2012 01:26, Tejun Heo wrote:
On Fri, Aug 24, 2012 at 04:01:37PM +0200, Daniel Wagner wrote:
quoted
@@ -306,6 +312,11 @@ static void __exit exit_cgroup_cls(void)
  	synchronize_rcu();
  #endif

+#if IS_MODULE(CONFIG_NET_CLS_CGROUP)
+	static_key_slow_dec(&cgroup_cls_enabled);
+	rcu_barrier();
Why is this rcu_barrier() necessary?
I have read the rcubarrier.txt document and I got from that that an 
rcu_barrier() is needed when unloading a module. But maybe I got it wrong.

So the idea after disabling the jump lables all pending readers in
task_cls_classid() have left. THe same thing is done in the old code 
with the dynamic id part. With the difference that synchronize_rcu() is 
used.
In general, please explain what
synchronization is going on when using sync constructs which aren't
obvious - e.g. memory barriers, rcu barriers.
Sure, I will keep this in mind.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help