linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernel: events: core: Replace rcu_assign_pointer() with RCU_INIT_POINTER()
@ 2014-08-22 13:26 Andreea-Cristina Bernat
  2014-09-09  9:42 ` Peter Zijlstra
  2014-09-09 14:53 ` [tip:perf/core] perf/core: " tip-bot for Andreea-Cristina Bernat
  0 siblings, 2 replies; 8+ messages in thread
From: Andreea-Cristina Bernat @ 2014-08-22 13:26 UTC (permalink / raw)
  To: a.p.zijlstra, paulus, mingo, acme, linux-kernel; +Cc: paulmck

The use of "rcu_assign_pointer()" is NULLing out the pointer.
According to RCU_INIT_POINTER()'s block comment:
"1.   This use of RCU_INIT_POINTER() is NULLing out the pointer"
it is better to use it instead of rcu_assign_pointer() because it has a
smaller overhead.

The following Coccinelle semantic patch was used:
@@
@@

- rcu_assign_pointer
+ RCU_INIT_POINTER
  (..., NULL)

Signed-off-by: Andreea-Cristina Bernat <bernat.ada@gmail.com>
---
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 0d735be..4b84dd5 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -5744,7 +5744,7 @@ static void swevent_hlist_release(struct swevent_htable *swhash)
 	if (!hlist)
 		return;
 
-	rcu_assign_pointer(swhash->swevent_hlist, NULL);
+	RCU_INIT_POINTER(swhash->swevent_hlist, NULL);
 	kfree_rcu(hlist, rcu_head);
 }
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-09-28  7:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-22 13:26 [PATCH] kernel: events: core: Replace rcu_assign_pointer() with RCU_INIT_POINTER() Andreea-Cristina Bernat
2014-09-09  9:42 ` Peter Zijlstra
2014-09-09 16:16   ` Paul E. McKenney
2014-09-10 13:12     ` Peter Zijlstra
2014-09-12 16:30       ` Paul E. McKenney
2014-09-26 14:53         ` Peter Zijlstra
2014-09-28  7:36           ` Paul E. McKenney
2014-09-09 14:53 ` [tip:perf/core] perf/core: " tip-bot for Andreea-Cristina Bernat

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).